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 voidassertDoAfterBody(int expectedValue)Assert that the return value of doAfterBody is equal to an expectedValuevoidassertDoEndTag(int expectedValue)Assert that the return value of doEndTag is equal to an expectedValuevoidassertDoStartTag(int expectedValue)Assert that the return value of doStartTag is equal to an expectedValueMockJspWritergetOutWriter()MockPageContextgetPageContext()voidtestDoInitBody()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 JspExceptionAssert 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 JspExceptionInvoke doInitBody on the test subject- Throws:
JspException
-
assertDoAfterBody
public void assertDoAfterBody(int expectedValue) throws JspExceptionAssert 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 JspExceptionAssert that the return value of doEndTag is equal to an expectedValue- Parameters:
expectedValue- value to check against doEndTag- Throws:
JspException
-
-