Ravi C Kota

Ranch Hand
+ Follow
since Jan 29, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ravi C Kota

Thanks Bear,

Will do some research on "opener"


Hello All,

I'm working on a sample project, where in upon clicking a button or hyperlink, a popup window is opened and some values entered on that popup are required to be updated back on the original page. To put it simple,

for eg, If I click a button on page A, a popup page B. I entered some values on page B and it goes to server for some processing and the results are returned back. However, I need that response to be updated back on page A.

My gut feeling is it is NOT possible. However, since I saw similar prefill kind of applications in Banks, I'm thinking that it is possible but with some tweaks. How can this be done?

Does Spring provide any built in features for this kind of usecase?

For now, to mimic it, the server is rendering the page A after processing, so that way I see that PageA is displayed. But that PageA is not the same PageA originally the request is sent. I see both pages in separate browser windows...


or Am I sounding stupid ?
Hi All,

Recently in one of my projects, I started using EasyMock framework for mocking the objects. I'm not using EasyMock extensions, so I'm currently not able to mock static or private methods. Well I'm not complaining about it now, as I knew I need to use EasyMock extension. But the way I'm mocking the objects seem to be stupid to me and clearly it does not follow Test Driven approach. Please guide me on proper usage of the EasyMock or other better framework.

Currently, I'm mocking every step of execution (including the sequence of execution) using EasyMock based on the actual implementation of the class under test. This seems so wrong to me. If I had to change the sequence of execution, but keeping the net outcome as same, still I need to change my tests. I knew that I'm doing something wrong here.

For eg,



As you see, execute() method of ClassA, is invoking execute() methods of classB, classC, ClassD and some more processing, independent of these executes. Also, the sequence of execution also does not really matter. If I need to test execute() of A, I can mock B, C,D and write something like

EasyMock.expect(b.execute()).andReturn()
EasyMock.expect(c.execute()).andReturn()
EasyMock.expect(d.execute()).andReturn()

But what I'm currently doing here is I need to execute these steps in the same sequence they are being executed in actual class. The worst is, I need to do the same even for other processing that goes in parallel.

This is apparently not a test driven approach and rather I would call it as code driven testing. So I wanted to know, if this is a limitation of EasyMock or a limitation of my knowledge in EasyMock. If it is really a limitation with EasyMock, then is there any better framework I can use, where I can create all mocks objects and methods upfront and do not bother about placing them in exact sequence.

Can a good pointer for examples be provided for EasyMock or for other such frameworks?

Thanks



13 years ago
Hi All,

While I was working on some unit tests using EasyMock, I ended up with the exception java.lang.IllegalStateException: no last call on a mock available, quite often.

Below is the program, that needs to be tested.



Now I need to write some unit tests for Main and mocking IInterface, for now

My code is as follows


I need to admit that I have not worked on EasyMocks before and pretty good chances that I did not set it up correctly in my test. But then, I need guidance in setting up the test correctly.

I'm using EasyMock 3.0.

When I ran my test, it is failing with the exception java.lang.IllegalStateException: no last call on a mock available, pointing at line

EasyMock.expect(a.function()).andReturn("test");

Can somebody guide me ?

Thanks
13 years ago
Rajashree,

How far did you code to accomplish this task ? First of all it has nothing to do with JSP. Secondly, you identify the text box with an id and in some sort of javascript, you can disable it as you do in any html page. For your reference, take a look at HTML DOM
13 years ago
JSP
Route what you actually read from Request to a console and see what you actually get and then you may find what might be missing. Did you try to debug the program ?

What do you see in buffer, after executing request.getInputStream().read(buffer) ;
13 years ago

Kousik Majumder wrote:Hi All,

Can somebody explain me why javax.servlet.Servlet is an interface NOT an abstract class?
Please help.



Servlet defines set of methods that can be invoked by the container. So defining the required functionalities upfront is a good approach. and if you notice, there is an abstract class called GenericServlet that implements Servlet Interface which in turn all other Servlets have been extended.

Is there any specific reason you think it should have been an abstract class rather than Servlet? As far as I understand, it is how they designed the framework. They wanted to define the functionalities first and then come up with implementation at a later point. So interface first and then implementation.
13 years ago
Thats an awesome score...

Congratulations.... How did you feel about this test ?
Yeah, I think that was a stupid move by Oracle, but unfortunately that would be the reality shortly... so better to be prepared for shedding some huge bucks:-)
Yep, I can access site normally.. Thanks .
13 years ago
Hi All,

Since this morning, when I tried to access www.coderanch.com, I'm being prompted for credentials, with a window dialog box being opened. But when I enter my login details, it is not letting me in. Is there any change in access the site. I somehow, googled some threads in the forum and then accessed the site.

13 years ago
Well, I found one here. Is this what you are referring to ?
13 years ago
Question to Poornima,

Since you mentioned that you are learning WS using Axis2 and implemented Rampart security, would you mind sharing the details of your example, any pointers I too can refer, as I too wanted to learn the same.

Thanks
13 years ago
First of all, I would like to thank all the forum members for their guidance, suggestions and answers which helped me to clear OCDJWS 5.0 today. My special thanks to Ivan and Mikalai and their notes are really awesome, specially when there is no official guide available targetted for OCDJWS 5.0.

Coming to my experience about the test.

1) Minimum percentage for the exam is 42%, secured 76%.
2) Complexity = considerably tough, compared to SCJP (as I did not experience other tests)
3) Kind of questions = mostly usecase scenarios and recommended approaches, based on requirements.

There were several other questions, that deal directly with api like
1) How to parse xml using SAX
2) What steps are needed in JAXB usage.
3) How to handle SAAJ etc.

Ofcourse, do not forget to rememeber, BP conformance, SOAP, WSDL structures and some basic XML/XSD stuff.

As I mentioned above, high importance was given to recommended approach based on certain set of requirements, so try to concentrate more on those areas.

A week before the final test, I attempted the mock test (Mikalai's) and I was able to identify my gray areas and concentrated more on them.

Thanks to all the folks, once again and wish all the best for test takers.

After a brief pause, I will start working on SCEA, as I wanted to get that completed before August 1,2011.

Thanks