com.mockobjects.helpers

Class 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

TagTestHelper(Tag testSubject)

Method Summary

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

Constructor Details

TagTestHelper

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

Method Details

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

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

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

getOutWriter

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

getPageContext

public MockPageContext getPageContext()

testDoInitBody

public void testDoInitBody()
            throws JspException
Invoke doInitBody on the test subject

Copyright © 2002 Mock Objects. All Rights Reserved.