org.apache.pluto.testsuite.test
Class AbstractReflectivePortletTest

java.lang.Object
  extended by org.apache.pluto.testsuite.test.AbstractReflectivePortletTest
All Implemented Interfaces:
PortletTest
Direct Known Subclasses:
ActionParameterTest, AppScopedSessionAttributeTest, ContextInitParameterTest, DispatcherRenderParameterTest, DispatcherRequestTest, ExternalAppScopedAttributeTest, MiscTest, PreferenceCommonTest, RenderParameterTest, RenderResponseNoContentTypeTest, ResourceBundleTest, SecurityMappingTest, SessionTimeoutTest, SimpleAttributeTest

public abstract class AbstractReflectivePortletTest
extends java.lang.Object
implements PortletTest


Constructor Summary
AbstractReflectivePortletTest()
           
 
Method Summary
 void doHeaders(PortletConfig config, PortletContext context, RenderRequest request, RenderResponse response)
          Called by TestPortlet.doHeaders()
 TestResults doTest(PortletConfig config, PortletContext context, PortletRequest request, PortletResponse response)
          Invoke test methods using java reflection.
 TestConfig getConfig()
          Returns the test configuration.
protected  java.util.Map<java.lang.String,java.lang.String> getInitParameters()
           
 java.util.Map<java.lang.String,java.lang.String[]> getRenderParameters(PortletRequest request)
          Returns the render parameters that will be set into the render request.
 java.lang.String getTestSuiteName()
          Returns the test suite name.
 void init(TestConfig config)
          Initializes the portlet test using test configuration.
 java.lang.String toString()
          Override of toString() that prints out names and values of variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractReflectivePortletTest

public AbstractReflectivePortletTest()
Method Detail

init

public void init(TestConfig config)
Description copied from interface: PortletTest
Initializes the portlet test using test configuration.

Specified by:
init in interface PortletTest
Parameters:
config - the test configuration.

getRenderParameters

public java.util.Map<java.lang.String,java.lang.String[]> getRenderParameters(PortletRequest request)
Returns the render parameters that will be set into the render request. The default implementation just returns an empty Map object. This method may be overwritten by some concrete test to provide test-specific render parameters.

Specified by:
getRenderParameters in interface PortletTest
Parameters:
request - the portlet request.
Returns:
an empty Map object.

getConfig

public TestConfig getConfig()
Description copied from interface: PortletTest
Returns the test configuration.

Specified by:
getConfig in interface PortletTest
Returns:
the test configuration.

getTestSuiteName

public java.lang.String getTestSuiteName()
Returns the test suite name. The test suite name is the portlet test class name without package name prefix.

Specified by:
getTestSuiteName in interface PortletTest
Returns:
the test suite name.

doTest

public TestResults doTest(PortletConfig config,
                          PortletContext context,
                          PortletRequest request,
                          PortletResponse response)
Invoke test methods using java reflection. All 'check*' methods are invoked and test results are saved into TestResults object.

Specified by:
doTest in interface PortletTest
Parameters:
config - the portlet config.
context - the portlet context.
request - the portlet request.
response - the portlet response.
Returns:
the test results including several TestResult instances.

getInitParameters

protected java.util.Map<java.lang.String,java.lang.String> getInitParameters()

toString

public java.lang.String toString()
Override of toString() that prints out names and values of variables.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

doHeaders

public void doHeaders(PortletConfig config,
                      PortletContext context,
                      RenderRequest request,
                      RenderResponse response)
Description copied from interface: PortletTest
Called by TestPortlet.doHeaders()

Specified by:
doHeaders in interface PortletTest


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.