|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.jsfunit.framework.WebClientSpec
public class WebClientSpec
The WebClientSpec allows configuration of the HtmlUnit WebClient and its interaction with JSFUnit.
Field Summary | |
---|---|
static String |
SESSION_KEY
|
Constructor Summary | |
---|---|
WebClientSpec(String initialPage)
Create a new WebClientSpec. |
|
WebClientSpec(String initialPage,
com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
Create a new WebClientSpec. |
|
WebClientSpec(String initialPage,
com.gargoylesoftware.htmlunit.BrowserVersion browserVersion,
String proxyHost,
int proxyPort)
Create a new WebClientSpec for use with a proxy server. |
Method Summary | |
---|---|
void |
addCookie(String name,
String value)
Add a cookie that will be sent with every request. |
protected void |
addCookiesToHeader()
|
com.gargoylesoftware.htmlunit.Page |
doInitialRequest()
Perform the initial request to the server. |
com.gargoylesoftware.htmlunit.BrowserVersion |
getBrowserVersion()
Get the BrowserVersion to be used by the WebClient. |
Map<String,String> |
getCookies()
Get an unmodifiable Map of all the cookies to be sent with each request. |
String |
getInitialPage()
Return the initialPage passed into the constructor. |
String |
getProxyHost()
Get the Proxy Host used by the WebClient. |
int |
getProxyPort()
Get the Proxy Port used by the WebClient. |
static Map |
getRedirectorRequestParams()
Get an immutable Map of all request params sent to the ServletRedirector or ServletTestRunner. |
com.gargoylesoftware.htmlunit.WebClient |
getWebClient()
Get the WebClient instances used for the JSFSession. |
String |
removeCookie(String name)
Remove a cookie sent with every request. |
void |
setInitialRequestStrategy(InitialRequestStrategy requestStrategy)
Set the strategy to be used when making the initial request to the server. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
|
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SESSION_KEY
Constructor Detail |
---|
public WebClientSpec(String initialPage)
initialPage
- The page used to start a client session with JSF. Example: "/index.jsf"public WebClientSpec(String initialPage, com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
initialPage
- The page used to start a client session with JSF. Example: "/index.jsf"browserVersion
- The browser version to simulate.public WebClientSpec(String initialPage, com.gargoylesoftware.htmlunit.BrowserVersion browserVersion, String proxyHost, int proxyPort)
initialPage
- The page used to start a client session with JSF. Example: "/index.jsf"browserVersion
- The browser version to simulate.proxyHost
- The proxy server.proxyPort
- The proxy port.Method Detail |
---|
public static Map getRedirectorRequestParams()
public String getInitialPage()
public com.gargoylesoftware.htmlunit.WebClient getWebClient()
public com.gargoylesoftware.htmlunit.BrowserVersion getBrowserVersion()
public String getProxyHost()
public int getProxyPort()
public void setInitialRequestStrategy(InitialRequestStrategy requestStrategy)
requestStrategy
- The InitialRequestStrategy implementation.public void addCookie(String name, String value)
name
- The cookie name.value
- The cookie value.public String removeCookie(String name)
name
- The name of the cookie
public Map<String,String> getCookies()
public com.gargoylesoftware.htmlunit.Page doInitialRequest() throws IOException
IOException
- if HtmlUnit encountered an error.protected void addCookiesToHeader()
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueBound(javax.servlet.http.HttpSessionBindingEvent httpSessionBindingEvent)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |