Package com.mockobjects.helpers
Class TagTestHelper
java.lang.Object
com.mockobjects.helpers.AbstractServletTestHelper
com.mockobjects.helpers.TagTestHelper
Sets up mock tag objects in a common configuration.
MockHttpServletRequest, MockServletContext and MockHttpSession are attached to MockPageContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 expectedValuevoid
Invoke doInitBody on the test subjectMethods inherited from class com.mockobjects.helpers.AbstractServletTestHelper
getHttpSession, getRequest, getRequestDispatcher, getResponse, getServletConfig, getServletContext
-
Constructor Details
-
TagTestHelper
public TagTestHelper(Tag testSubject) - Parameters:
testSubject
- The Tag to be tested
-
-
Method Details
-
getOutWriter
- Returns:
- The writer use when making calls to PageContext.getOut
-
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 JspExceptionInvoke 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
-