com.google.code.rees.scope.struts2.test
Class ScopeTestUtil

java.lang.Object
  extended by com.google.code.rees.scope.struts2.test.ScopeTestUtil

public class ScopeTestUtil
extends Object

A utility for simplifying Struts2 unit testing against the interceptor stack

Author:
rees.byars

Constructor Summary
ScopeTestUtil()
           
 
Method Summary
static void extractScopeFields(Object target)
          The current values of session and conversation fields that are annotated with SessionField and ConversationField are extracted from the target object and placed into the session and the active conversations available in the current thread.
protected static String getActionSuffix()
           
static ConversationConfigurationProvider getConfigurationProvider()
           
static void injectScopeFields(Object target)
          The target object's session and conversation fields that are annotated with SessionField and ConversationField are injected from the session and the active conversations available in the current thread.
static void setConversationIdsOnRequest(org.springframework.mock.web.MockHttpServletRequest request, Class<?> actionClass)
          For unit testing, sets the conversation IDs of the conversations in the current thread onto a given mock request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopeTestUtil

public ScopeTestUtil()
Method Detail

getConfigurationProvider

public static ConversationConfigurationProvider getConfigurationProvider()

getActionSuffix

protected static String getActionSuffix()

setConversationIdsOnRequest

public static void setConversationIdsOnRequest(org.springframework.mock.web.MockHttpServletRequest request,
                                               Class<?> actionClass)
For unit testing, sets the conversation IDs of the conversations in the current thread onto a given mock request.

Parameters:
request -

extractScopeFields

public static void extractScopeFields(Object target)
The current values of session and conversation fields that are annotated with SessionField and ConversationField are extracted from the target object and placed into the session and the active conversations available in the current thread.

Parameters:
target -

injectScopeFields

public static void injectScopeFields(Object target)
The target object's session and conversation fields that are annotated with SessionField and ConversationField are injected from the session and the active conversations available in the current thread.

Parameters:
target -


Copyright © 2012-2013. All Rights Reserved.