Package 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
-
-
Constructor Summary
Constructors Constructor Description TagTestHelper(Tag testSubject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertDoAfterBody(int expectedValue)
Assert that the return value of doAfterBody is equal to an expectedValuevoid
assertDoEndTag(int expectedValue)
Assert that the return value of doEndTag is equal to an expectedValuevoid
assertDoStartTag(int expectedValue)
Assert that the return value of doStartTag is equal to an expectedValueMockJspWriter
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
-
-
-
-
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
-
-