jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmk...@earthlink.net (David M. Karr)
Subject Re: Testing response from information in request?
Date Sat, 20 Jul 2002 17:12:37 GMT
>>>>> "David" == David M Karr <dmkarr@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++

To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>

View raw message