Hi Soren,
I have just checked the JSP 1.1 specification. Have a look at Sectio, 6.1.4
(page 117 in the spec I have). It lists all the methods available on the
pageContext object.
There is a pageContext.getOut() method that returns the JspWriter. I guess
you can use that.
Thanks
-Vincent
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 14, 2001 11:09 AM
Subject: new com.sun.jsp.compiler.JspReader( ((JspTestCase)this).out ) ?
I'm trying to test my custom taglibs and the code executes fine. But how do
I access the contents of the JspWriter to check that the correct output was
written? I'm sure the answer is obvious and that all I need is some fresh
air ;-)
public class MyTagTest extends JspTestCase {
public void testMyTag()
throws java.io.IOException, javax.servlet.ServletException {
try {
PrintCommentTag pct = new PrintCommentTag(); // no
bodycontent needed for this tag
pct.setPageContext(pageContext);
pct.setScope("request");
pct.setColumn("addrlin1");
pct.doStartTag();
pct.doEndTag();
pct.release();
pct = null;
} catch(JspException jspe) {
jspe.printStackTrace();
throw new ServletException(jspe);
}
// assertTrue(?);
}
}
Regards,
S�ren Bro