com.mockrunner.base
Class WebTestModule

java.lang.Object
  extended by com.mockrunner.base.WebTestModule
Direct Known Subclasses:
HTMLOutputModule

public abstract class WebTestModule
extends java.lang.Object

This class provides some convenience methods for request and session attribute handling


Constructor Summary
WebTestModule(WebMockObjectFactory mockFactory)
           
 
Method Summary
 void addRequestParameter(java.lang.String key)
          Adds an empty request parameter.
 void addRequestParameter(java.lang.String key, java.lang.String value)
          Adds a request parameter.
 void addRequestParameter(java.lang.String key, java.lang.String[] values)
          Adds several request parameters.
 java.lang.Object getRequestAttribute(java.lang.String key)
          Returns the request attribute for the specified key
 java.lang.String getRequestParameter(java.lang.String key)
          Returns the request parameter for the specified key
 java.lang.Object getSessionAttribute(java.lang.String key)
          Returns the session attribute for the specified key
 void setRequestAttribute(java.lang.String key, java.lang.Object value)
          Sets the request attribute for the specified key
 void setSessionAttribute(java.lang.String key, java.lang.Object value)
          Sets the session attribute for the specified key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebTestModule

public WebTestModule(WebMockObjectFactory mockFactory)
Method Detail

addRequestParameter

public void addRequestParameter(java.lang.String key)
Adds an empty request parameter. Same as addRequestParameter(key, "").

Parameters:
key - the request key

addRequestParameter

public void addRequestParameter(java.lang.String key,
                                java.lang.String value)
Adds a request parameter.

Parameters:
key - the request key
value - the request value

addRequestParameter

public void addRequestParameter(java.lang.String key,
                                java.lang.String[] values)
Adds several request parameters.

Parameters:
key - the
values - the request values

getRequestParameter

public java.lang.String getRequestParameter(java.lang.String key)
Returns the request parameter for the specified key

Parameters:
key - the request key
Returns:
the parameter

getRequestAttribute

public java.lang.Object getRequestAttribute(java.lang.String key)
Returns the request attribute for the specified key

Parameters:
key - the request key
Returns:
the attribute

setRequestAttribute

public void setRequestAttribute(java.lang.String key,
                                java.lang.Object value)
Sets the request attribute for the specified key

Parameters:
key - the request key
value - the value

getSessionAttribute

public java.lang.Object getSessionAttribute(java.lang.String key)
Returns the session attribute for the specified key

Parameters:
key - the session key
Returns:
the attribute

setSessionAttribute

public void setSessionAttribute(java.lang.String key,
                                java.lang.Object value)
Sets the session attribute for the specified key

Parameters:
key - the session key
value - the value