Class TagTestHelper


public class TagTestHelper extends AbstractServletTestHelper
Sets up mock tag objects in a common configuration. MockHttpServletRequest, MockServletContext and MockHttpSession are attached to MockPageContext
  • Constructor Details

    • TagTestHelper

      public TagTestHelper(Tag testSubject)
      Parameters:
      testSubject - The Tag to be tested
  • Method Details

    • getOutWriter

      public MockJspWriter getOutWriter()
      Returns:
      The writer use when making calls to PageContext.getOut
    • getPageContext

      public MockPageContext getPageContext()
    • assertDoStartTag

      public void assertDoStartTag(int expectedValue) throws JspException
      Assert that the return value of doStartTag is equal to an expectedValue
      Parameters:
      expectedValue - value to check against doStartTag
      Throws:
      JspException
    • testDoInitBody

      public void testDoInitBody() throws JspException
      Invoke doInitBody on the test subject
      Throws:
      JspException
    • assertDoAfterBody

      public void assertDoAfterBody(int expectedValue) throws JspException
      Assert that the return value of doAfterBody is equal to an expectedValue
      Parameters:
      expectedValue - value to check against doAfterBody
      Throws:
      JspException
    • assertDoEndTag

      public void assertDoEndTag(int expectedValue) throws JspException
      Assert that the return value of doEndTag is equal to an expectedValue
      Parameters:
      expectedValue - value to check against doEndTag
      Throws:
      JspException