Sathiesh Kumar Vs

Ranch Hand
+ Follow
since Oct 24, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sathiesh Kumar Vs

Hi...

I got the solution for this.. For the object being created inside the method, using Easymock.anyObject() helps me to set the expectation.



Also, Using IAnswer, i am able to set the answer to the void method by getting the input object that it is using.

9 years ago
Isn't there any way to mock objects that are created as new Object() within the method ?
9 years ago
I am using EasyMock and EasyMock CE 3.0 to mock dependent layers and test my classes. Below is the scenario for which I am not able to find any solution

I have class to be tested, which calls a dependent class void method that takes an input param, and alters the same param. The method that I am testing is doing some operations based on the altered param, which I have to test now for various scenarios

Consider the below sample, where I have tried to put the same scenario

public boolean voidCalling(){
boolean status = false;
SampleMainBean mainBean = new SampleMainBean();
dependentMain.voidCalled(mainBean);
if(mainBean.getName() != null){
status = true;
}else{
status = false;
}
return status;
}
And the dependentMain class the below method

public void voidCalled(SampleMainBean mainBean){
mainBean.setName("Sathiesh");
}
To have full coverage, I need to have 2 test cases to test both the scenarios where true and false are returned, but I always get false as I am not able to set the behaviour of the void method to alter this input bean. How can I get a true as result in this scenario using EasyMock

Thanks in advance for any help.
9 years ago
Hi,

I am facing a weird problem for which I am not able to find any root cause.

I am firing a request from my GWT Page, which does some DB operations and calls a web service.
I am seeing that in the logs, once the Web service request is fired, before the response comes back, there is an another HTTP request being fired for the same..
This is starting right from the filter....

I am not able to get any lead on this.

I am using IHS web server, WAS App server in Unix env.
9 years ago
Hi

I am using IBM JAX WS 2 on my WAS server and exposing a service. The purpose of this service is to send some data to the consumer, which I already have in my database in form of an XML. I just need to put this xml in the response and send it.
I want to avoid the JAXB Marshaling and marshaling here as I don't have to do anything else with the data.

So I am trying to directly place the XML to the JAXWS response. I was trying to use anyType, but my client doesn't want a anyType in their WSDL but they want a proper XSD.

Is there way I can create a payload and send as a response ? In that case how would my JAXB Service impl look like ? How to achieve this ?
10 years ago
Seems your need is to run() a thread inside some other method.

If that is the case, you will have to create a Separate Thread and implements run() method in that. And use that thread here as Campbell said.
Or you can use an anonymous inner class.

Sorry, If I misunderstood your question.
10 years ago
Hi

As Mathew said, you are trying to access the protected variable on the reference of the Super class, which you cannot do.
This is as well same as OtherSubClassA not extending ClassA.
10 years ago
Sorry if I misunderstood your problem

I believe there should not be any problem depending on what the technology that you use and the service provider uses, as long as you both use the same Soap version. That is the core benefit of using a web service.

The beans generation may be different based on different web service frame works as the vendors would use their own binding mechanism, but JAXB is one standard binding technique that everyone wants to move to.

Still the XML generated out of the beans would be same, irrespective of the binding technique. If you still see some differences I think you can use custom handlers to tamper requests and responses
A a = new A();
a.m1();

new A().m1();

Both are same in terms of method invocation. Only difference is in the first case you still have the reference of the created object but in the second you don't have.
10 years ago
Hi Nauman,

Sorry am more confused now as in what is your exact requirement.

i am new in java and i want to know that how to update multiple tables in JFrame using Ms access database


now i know how to retrieve data from database using one table but don't how to retrieve data using multiple tables



To my knowledge what you are looking for is all about Sql queries. If you want to retrieve data from more than one table you can use
joins and get the data


If you want to update data back into multiple tables you cant do that in a single query. Read SQL tutorials for a better understanding.


Hi Ramesh,

As Bear and Paul mentioned you would need refractor your code pretty much.

For every http request,
- the servlet container creates a request and response objects.
- your servlet uses the data in the request to process
- it sets back necessary data in the response object
- the Servlet container based on your page forward responds back as a jsp

At this last step when the response leaves your container, your outputstream will be committed and you cannot modify it later.
Here you are trying to modify the committed response in your result jsp which will throw you a response saying outputstream is already committed


10 years ago
JSP
Hi,

If I have not misunderstood you, what you mean here by an auto generated Impl must be just a Impl class that has the methods of the interface that just returns a null... That's the maximum eclipse or any tool can do, and you will have write your own implementation for that method that you are exposing as a web service.

If you are worried only about this empty Impl class that is not getting generated, please go thru the WSConsume features. You definitely should be able to write your own impl. I cannot give you better idea on it because I have not used JBOSS ever...
10 years ago
Hi,

Ya that was the last option that I was hoping. But when I go for Customer Handlers, I need to track both the requests and responses for limiting this count.
I was looking for options where we can achieve this through some configurations in JAXWS. Isnt there really a way to do it ?
10 years ago
Hi,

I have a JAX WS web service running on a WAS 6 server. Is there a way I can set a throttle count to this web service.
I don't want to change the jvm properties on the server, which will effect the change for all services. I need to restrict the request count only on one particular service.
Is there a way ?
10 years ago
Hey Prem,

I havent changed the package name. The service is in a web project for which I have an associated Java Project. I have moved the beans to that java project under the same package that is declared by the namespace in wsdl.
Also the web project has the java project in its build path dependency.
10 years ago