[EMAIL PROTECTED] wrote:
>
> Hmm, I was too fast.
>
> >There is a pageContext.getOut() method that returns the JspWriter. I guess
> >you can use that.
>
> PageContext.getOut() returns the same JspWriter which is contained in the
> JspTestCase
> which brings me back to square one :-(, altough PageContext.getPage() looks
> interesting... hmm...
if you need to check what is written by the tag then you need to use the
endXXX method.
Or do you want to keep the test executing entirely on the server? in
which case we need more code :) JspWriter does not have methods to allow
you to access the content of the stream, the only way is to either wrap
the JspWriter (been talked about in a few posts) or to test the results
in the endXXX method - which is obviously a PITA if you have set up
state on the server, and want to compare the output against that state.
Seeing the code you're trying to test, perhaps you can test in endXXX?
Is there a need for being able to do assertions on output on the server
side? if so we're back to needing wrapper classes for pagecontext and
jspwriter to be able to test the output of tags.
There was an earlier thread started by Robert Girarding title "Testing
tag libraries" that may be worth you looking at if you haven't already.
Jari
>
> Regards,
> S�ren
>
--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd