saipraneeth nallapareddy

Ranch Hand
+ Follow
since Dec 02, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by saipraneeth nallapareddy

I have noticed like my post has been edited, i am sorry if some thing what i mean to say didn't make any sense but the content of the post which has been modified is

Bear Bibeault edited it as wrote: but i am unable to make a http post using the same.


but i am facing the problem in making https post, i am not sure whether XmlHttpRequest is to be used for a https post, please correct me if i am wrong, but what i need is to make a https post, so i restored the content of the post i made here as

but i am unable to make a https post using the same.

Thanks for the reply Eric

You can not make XMLHttpRequest calls from http to https and https to http because of the same origin policy.


I am not making the call from http to https or vice versa, my requests and responses are to https only.
hello ranchers
I am trying to connect to an url which is on https, i am fine with the http post in java script using XmlHttpRequest, but i am unable to make a https post using the same.
Actually the java script is a part of the Phonegap which is no way different from how the java script being handled in a browser.
One more question i have is, how to provide the security certificate in order to make the https communication.
Can any one please provide me with the piece of code to make the https post.

Harald Kirsch wrote:
Then the one book I think every Java develper should have read:

"Clean Code" by Robert C. Martin



i will go with Harald Kirsch, that is really a good one.
7 years ago
hello ranchers,

i am trying to get the data from a restful webservice which is running using a java client program. I am able to connect to it and get the data, but the limitation in my code is that it can't connect to the restful endpoint which needs authentication. I h've tried search for this over online but couldn't get a proper clue. Can any one help me out.

The intention is to pass the username and password to the rest url where the authentication is required.

the two types of approaches i h've made is
7 years ago
hi fellow ranchers,
I have planned to take the exam SCJP6 with the exam code CX-310-065 but with the latest exam code 1Z0-851 what are the changes with the exam pattern and any other useful information.
Now I have decided to take the exam soon without any post-phone(by OCT end), so what are the areas i have to look in, please suggest.
thanks for your reply but i have resolved it myself, it is due to other jar conflicts, the app basically a web app so there were other jars which led to those errors.
7 years ago
i am a newbie of power mock, i am actually facing a few set of issues when i included power mock into my application.
I am using mockito(mockito-all-1.8.5.jar) and i included the compitable version of power mock for this(powermock-mockito-1.4.9-full and its dependencies) when i run the test mocking a static class and individually running the test through eclipse IDE the test are running fine and as expected.

But when i run cumulatively all the tests by using ant i am facing an error
If you can observe the errors are being showed as test case which i h've not included in my test suit

Test mechanism Error java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
the trace is
[junit] Testcase: Test mechanism: Caused an ERROR
[junit] java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:52)
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:26)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.clearThreadLocalIn(MockCreator.java:157)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.clearMockProgress(MockCreator.java:148)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.run(MockCreator.java:143)
[junit] at org.powermock.core.MockRepository.clear(MockRepository.java:121)
[junit] at org.powermock.reflect.internal.WhiteboxImpl.performMethodInvocation(WhiteboxImpl.java:2014)
[junit] at org.powermock.reflect.internal.WhiteboxImpl.doInvokeMethod(WhiteboxImpl.java:885)
[junit] at org.powermock.reflect.internal.WhiteboxImpl.invokeMethod(WhiteboxImpl.java:859)
[junit] at org.powermock.reflect.Whitebox.invokeMethod(Whitebox.java:466)
[junit] at org.powermock.modules.junit4.common.internal.impl.PowerMockJUnit4RunListener.testFinished(PowerMockJUnit4RunListener.java:55)
[junit] at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:207)
[junit] at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:146)
[junit] at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
[junit] at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:118)
[junit] at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102)
[junit] at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
[junit] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
[junit] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
[junit] Caused by: java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:247)
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:50)


the above error is only for the first test suit(power mock uesd in this) which the compiler comes across, but runs all the test cases in that suit as expected. The remaining test suits with power mock used are not getting any test being run but facing the following error.

initializationError Error java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
the trace is
[junit] Testcase: initializationError(com.cscinfo.pb.web.action.myDocuments.UploadMatterDocumentActionTest): Caused an ERROR
[junit] java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:52)
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:26)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.clearThreadLocalIn(MockCreator.java:157)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.clearMockProgress(MockCreator.java:148)
[junit] at org.powermock.api.mockito.internal.mockcreation.MockCreator$MockitoStateCleaner.run(MockCreator.java:143)
[junit] at org.powermock.core.MockRepository.clear(MockRepository.java:121)
[junit] at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:42)
[junit] at org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:26)
[junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[junit] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
[junit] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
[junit] Caused by: java.lang.ClassNotFoundException: org.mockito.internal.progress.ThreadSafeMockingProgress
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:247)
[junit] at org.powermock.api.support.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:50)


7 years ago
@Aditya Jha
Thank you, it seems like forgetting basic, rather than thinking in deep i h've to stick to basics. Any way thank you.
7 years ago
I am stuck in a point about hierarchy, take a look into the following code.




Now my question is i have the spr a reference of type SuperClass and is instantiated through the constructor of SubClass. Now when i call the getter method of the property which is common in both the classes i am getting the value of the property in sub class, how is a super class reference is able to view the method in the sub class? What is the point i am missing here.
7 years ago
hello ranchers

I have a scenario where when a call to particular method is being invoked it shouldn't be able to be invoked by other instances.Take a look into the following code.






my question is the logic method which has been synchronized should not be able to be invoked untill the first invocation finishes it's execution then realized that it's completely a different object so it forms a different entries on the heap which will reffered by x & y.
But i want the invocation of y to be restricted when x is using the logic method, what are the changes to be undergo.
i have solved it finally by using percentage encoding where space is replaced by %20.
thanks for those who replied me by going through the post and helped to solve the problem but finally i have solved the issue by myself.
7 years ago
I will get that string from a different method and i need pass to the file in order to create the stream.
7 years ago

mohamed sanaullah wrote:



In doing so and passing to the File it is recognizing the path but also adding the quote at the end.

but still i am facing the same error escaped absolute path not valid.
7 years ago
I thought you know a process to get the path and you are asking me return.
This is the similar code that i used


mohamed sanaullah wrote: You should be able to get the path before calling the method to upload the file


how you are able to do.

Let me know how to add the double quote to the path
7 years ago