You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/07/20 06:44:46 UTC
Testing response from information in request?
I'm trying to write a test case for a JSP tag using Cactus and HTTPUnit. The
outgoing request has information that the tag code will use to generate HTML.
I want to validate the generated output. In my "end..." method I can get the
response, get the DOM tree, and look at the tags and values generated. In the
"test..." method, I can read the values from the request so I can determine
exactly what values I should expect.
However, it appears that the "test..." and "end..." methods are executed in
different instances (the server and client). I can't figure out how I can
validate the response against information in the request, as I can't read both
of them in the same place, or store information from the request that I can
look at later.
Is there an easy way to resolve this sort of problem?
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Testing response from information in request?
Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "David" == David M Karr <dm...@earthlink.net> writes:
David> I'm trying to write a test case for a JSP tag using Cactus and HTTPUnit. The
David> outgoing request has information that the tag code will use to generate HTML.
David> I want to validate the generated output. In my "end..." method I can get the
David> response, get the DOM tree, and look at the tags and values generated. In the
David> "test..." method, I can read the values from the request so I can determine
David> exactly what values I should expect.
David> However, it appears that the "test..." and "end..." methods are executed in
David> different instances (the server and client). I can't figure out how I can
David> validate the response against information in the request, as I can't read both
David> of them in the same place, or store information from the request that I can
David> look at later.
David> Is there an easy way to resolve this sort of problem?
Never mind. I figured this out. In my "test..." method, before calling
"doStartTag()", I can pull the information out of the request, build the
expected string, and set it as a header in the response. The "end..." method
can read the header and do the comparison.
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>