Announcement Announcement Module
Collapse
No announcement yet.
MockPageContext and Tag testing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MockPageContext and Tag testing

    Hi, how do you use the MockPageContext in a JUnit test of a custom tag.

    I keep having errors, because the getOut method is not implemented in the mock.

    I am using a simple Custom tag which extended TagSupport, and fill the html with a simple :

    Code:
         JspWriter out = pageContext.getOut(); 
         StringBuffer sb = new StringBuffer();
         sb.append("my html output");
         out.print(sb); 
         out.flush();
    Thks

  • #2
    Maybe you should have a look at www.tagunit.org, a simple tools that allows unit testing of JSP tags.

    Comment

    Working...
    X