org.jboss.jsfunit.framework
Class WebConversationFactory

java.lang.Object
  extended by org.jboss.jsfunit.framework.WebConversationFactory

public class WebConversationFactory
extends Object

The WebConversationFactory manages the environment needed to set up the WebClientSpec to be used with an HtmlUnit WebClient.

Since:
1.0
Author:
Stan Silvert

Field Summary
static String JSF_UNIT_CONVERSATION_FLAG
           
static String WAR_URL
           
 
Method Summary
protected static void clearSession(javax.servlet.http.HttpSession session)
          Clear the HttpSession for use by the WebClientSpec and JSFSession.
static javax.servlet.http.HttpSession getSessionFromThreadLocal()
          Get the shared HttpSession from the ThreadLocal variable.
static String getWARURL()
          Get the base URL for this web app.
static String makeWARURL(javax.servlet.http.HttpServletRequest req)
          Returns the complete WAR URL including everything excluding the query params.
static void removeThreadLocals()
          Clean up the ThreadLocal variables set in setThreadLocals.
static void setThreadLocals(javax.servlet.http.HttpServletRequest req)
          Associates the HttpSession and WAR URL with ThreadLocals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSF_UNIT_CONVERSATION_FLAG

public static String JSF_UNIT_CONVERSATION_FLAG

WAR_URL

public static String WAR_URL
Method Detail

setThreadLocals

public static void setThreadLocals(javax.servlet.http.HttpServletRequest req)
Associates the HttpSession and WAR URL with ThreadLocals.

Parameters:
req - The request that kicks off the tests.

getSessionFromThreadLocal

public static javax.servlet.http.HttpSession getSessionFromThreadLocal()
Get the shared HttpSession from the ThreadLocal variable.

Returns:
The shared HttpSession.

makeWARURL

public static String makeWARURL(javax.servlet.http.HttpServletRequest req)
Returns the complete WAR URL including everything excluding the query params.

Parameters:
req - The request that kicks off the tests.
Returns:
The WAR URL as a String.

removeThreadLocals

public static void removeThreadLocals()
Clean up the ThreadLocal variables set in setThreadLocals.


clearSession

protected static void clearSession(javax.servlet.http.HttpSession session)
Clear the HttpSession for use by the WebClientSpec and JSFSession. We need to start with a clean (but not new) HttpSession at the beginning of each test.

Parameters:
session - The shared HttpSession

getWARURL

public static String getWARURL()
Get the base URL for this web app. This will return a String in the form scheme://servername:port/contextpath.

Returns:
The base URL for this web app.


Copyright © 2007-2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.