org.jboss.seam.mock
Class SeamTest.NonFacesRequest

java.lang.Object
  extended by org.jboss.seam.mock.BaseSeamTest.NonFacesRequest
      extended by org.jboss.seam.mock.SeamTest.NonFacesRequest
Enclosing class:
SeamTest

public class SeamTest.NonFacesRequest
extends BaseSeamTest.NonFacesRequest

A pass through to BaseSeamTest.NonFacesRequest. Deprecated, use BaseSeamTest.NonFacesRequest instead


Constructor Summary
SeamTest.NonFacesRequest()
           
SeamTest.NonFacesRequest(String viewId)
           
SeamTest.NonFacesRequest(String viewId, String conversationId)
           
 
Method Summary
protected  void afterRequest()
          Make some assertions, after the end of the request.
protected  void beforeRequest()
          Do anything you like, after the start of the request.
protected  String getConversationId()
           
 List<javax.servlet.http.Cookie> getCookies()
           
protected  javax.faces.context.FacesContext getFacesContext()
           
protected  Map<String,String[]> getHeaders()
           
protected  String getInvokeApplicationOutcome()
          Get the outcome of the INVOKE_APPLICATION phase
protected  String getOutcome()
          The outcome of the INVOKE_APPLICATION phase
protected  Map<String,String[]> getParameters()
           
 String getPrincipalName()
          Override to define the name of the current principal
 Set<String> getPrincipalRoles()
          Override to define the roles assigned to the current principal
protected  javax.mail.internet.MimeMessage getRenderedMailMessage(String viewId)
           
protected  String getRenderedViewId()
          Get the view id to be rendered
protected  Object getValue(String valueExpression)
          Evaluate (get) a value binding
protected  String getViewId()
          The JSF view id of the form that is being submitted or of the page that is being rendered in a non-faces request.
protected  void init()
           
protected  Object invokeAction(String actionMethodExpression)
          Simulate an action method
protected  Object invokeMethod(String methodExpression)
          Call a method binding
protected  boolean isInvokeApplicationBegun()
           
protected  boolean isInvokeApplicationComplete()
           
protected  boolean isRenderResponseBegun()
           
protected  boolean isRenderResponseComplete()
           
protected  boolean isValidationFailure()
          Did a validation failure occur during a call to validate()?
protected  void onException(Exception e)
           
protected  void renderResponse()
          Override to implement the interactions between the JSF page and your components that occurs during the render response phase.
 String run()
           
protected  void setOutcome(String outcome)
          Set the outcome of the INVOKE_APPLICATION phase
protected  void setPageParameter(String name, Object value)
           
protected  void setParameter(String name, String value)
           
protected  void setup()
          Deprecated. use beforeRequest()
protected  void setValue(String valueExpression, Object value)
          Set a value binding
protected  void setViewId(String viewId)
           
protected  void validate(Class modelClass, String property, Object value)
          Deprecated. use validateValue()
protected  boolean validateValue(String valueExpression, Object value)
          Validate the value against model-based constraints return true if the value is valid
 
Methods inherited from class org.jboss.seam.mock.BaseSeamTest.NonFacesRequest
applyRequestValues, invokeApplication, isGetRequest, processValidations, updateModelValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeamTest.NonFacesRequest

public SeamTest.NonFacesRequest()

SeamTest.NonFacesRequest

public SeamTest.NonFacesRequest(String viewId,
                                String conversationId)

SeamTest.NonFacesRequest

public SeamTest.NonFacesRequest(String viewId)
Method Detail

setPageParameter

protected void setPageParameter(String name,
                                Object value)

setParameter

protected void setParameter(String name,
                            String value)

getParameters

protected Map<String,String[]> getParameters()

getHeaders

protected Map<String,String[]> getHeaders()

getPrincipalName

public String getPrincipalName()
Override to define the name of the current principal

Returns:
"gavin" by default

getPrincipalRoles

public Set<String> getPrincipalRoles()
Override to define the roles assigned to the current principal

Returns:
a Set of all roles by default

getCookies

public List<javax.servlet.http.Cookie> getCookies()

getViewId

protected String getViewId()
The JSF view id of the form that is being submitted or of the page that is being rendered in a non-faces request. (override if you need page actions to be called, and page parameters applied)


setViewId

protected void setViewId(String viewId)

setOutcome

protected void setOutcome(String outcome)
Set the outcome of the INVOKE_APPLICATION phase


getOutcome

protected String getOutcome()
The outcome of the INVOKE_APPLICATION phase


getInvokeApplicationOutcome

protected String getInvokeApplicationOutcome()
Get the outcome of the INVOKE_APPLICATION phase


renderResponse

protected void renderResponse()
                       throws Exception
Override to implement the interactions between the JSF page and your components that occurs during the render response phase.

Throws:
Exception

setup

protected void setup()
Deprecated. use beforeRequest()

Override to set up any request parameters for the request.


afterRequest

protected void afterRequest()
Make some assertions, after the end of the request.


beforeRequest

protected void beforeRequest()
Do anything you like, after the start of the request. Especially, set up any request parameters for the request.


getRenderedViewId

protected String getRenderedViewId()
Get the view id to be rendered

Returns:
the JSF view id

validate

protected void validate(Class modelClass,
                        String property,
                        Object value)
Deprecated. use validateValue()


isValidationFailure

protected boolean isValidationFailure()
Did a validation failure occur during a call to validate()?


getFacesContext

protected javax.faces.context.FacesContext getFacesContext()

getConversationId

protected String getConversationId()

getValue

protected Object getValue(String valueExpression)
Evaluate (get) a value binding


setValue

protected void setValue(String valueExpression,
                        Object value)
Set a value binding


validateValue

protected boolean validateValue(String valueExpression,
                                Object value)
Validate the value against model-based constraints return true if the value is valid


onException

protected void onException(Exception e)

invokeMethod

protected Object invokeMethod(String methodExpression)
Call a method binding


invokeAction

protected Object invokeAction(String actionMethodExpression)
Simulate an action method


run

public String run()
           throws Exception
Returns:
the conversation id
Throws:
Exception - to fail the test

init

protected void init()

isInvokeApplicationBegun

protected boolean isInvokeApplicationBegun()

isInvokeApplicationComplete

protected boolean isInvokeApplicationComplete()

isRenderResponseBegun

protected boolean isRenderResponseBegun()

isRenderResponseComplete

protected boolean isRenderResponseComplete()

getRenderedMailMessage

protected javax.mail.internet.MimeMessage getRenderedMailMessage(String viewId)