Hi Christopher,

http://jakarta.apache.org/cactus/faq.html#faq4

Requirements like the one you formulated indicate that what you want to do is not really unit testing. It is not directly implementable with Cactus, although you could of course just open a HTTP connection in beginXXX(), and use the response to setup the test.

BTW, calling servlet.doGet() twice will probably yield unexpected behaviour, because the servlet will assume it is getting a fresh response in the second call, but indeed the response might be already written to and committed etc.

It might help if you told us *why* you want to do this?

-chris

Christopher Marshall wrote:
After reading through the documentation and the various mail messages from the list I am increasingly coming to the conclusion that what I would like to do is not possible with Cactus but since I am new to Cactus I thought I should ask.

I have a situation where a request needs to be made to a servlet and this returns a result that must be used in a subsequent request. Getting data from one test's endXXX method to another's beginXXX method doesn't seem to be possible or at least it isn't very obvious how one might do this. Making two different requests (calls to servlet.doGet) in the same testXXX method is very possible but how do you get at the data returned from the first request in the testXXX method before calling the second request?

Any suggestions would be welcome.

thanks,
Chris Marshall


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to