com.mockobjects.helpers

## Class TagTestHelper

- java.lang.Object
- - com.mockobjects.helpers.AbstractServletTestHelper
  - - com.mockobjects.helpers.TagTestHelper

-     public class TagTestHelper
      extends AbstractServletTestHelper

  Sets up mock tag objects in a common configuration. MockHttpServletRequest, MockServletContext and MockHttpSession are attached to MockPageContext
  See Also:
    `com.mockobjects.servlet.MockPageContext#setRequest();`, `com.mockobjects.servlet.MockPageContext#setServletContext();`, `com.mockobjects.servlet.MockPageContext#setSession();`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TagTestHelper(Tag testSubject)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assertDoAfterBody(int expectedValue)` Assert that the return value of doAfterBody is equal to an expectedValue
    `void` | `assertDoEndTag(int expectedValue)` Assert that the return value of doEndTag is equal to an expectedValue
    `void` | `assertDoStartTag(int expectedValue)` Assert that the return value of doStartTag is equal to an expectedValue
    `MockJspWriter` | `getOutWriter()`
    `MockPageContext` | `getPageContext()`
    `void` | `testDoInitBody()` Invoke doInitBody on the test subject

    - ### Methods inherited from class com.mockobjects.helpers.AbstractServletTestHelper

      `getHttpSession, getRequest, getRequestDispatcher, getResponse, getServletConfig, getServletContext`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TagTestHelper

          public TagTestHelper(Tag testSubject)

      Parameters:
        `testSubject` - The Tag to be tested

  - ### Method Detail

    - #### 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`

Copyright © 2002 Mock Objects. All Rights Reserved.