Results 1 to 2 of 2

Thread: MockPageContext and Tag testing

  1. #1
    Join Date
    Aug 2004
    Location
    Paris
    Posts
    43

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •