public class ServletUnitClient extends WebClient
WebClient.HeaderDictionary| Modifier and Type | Method and Description |
|---|---|
WebResponse |
getResponse(InvocationContext invocation)
Updates this client and returns the response which would be displayed by the
user agent.
|
javax.servlet.http.HttpSession |
getSession(boolean create)
Returns the session that would be used by the next request (if it asks for one).
|
static ServletUnitClient |
newClient(InvocationContextFactory factory)
Creates and returns a new servlet unit client instance.
|
InvocationContext |
newInvocation(java.lang.String requestString)
Creates and returns a new invocation context from a GET request.
|
InvocationContext |
newInvocation(WebRequest request)
Creates and returns a new invocation context to test calling of servlet methods.
|
protected WebResponse |
newResponse(WebRequest request,
FrameSelector targetFrame)
Creates a web response object which represents the response to the specified web request.
|
void |
setProxyServer(java.lang.String proxyHost,
int proxyPort)
Specifies a proxy server to use for requests from this client.
|
addClientListener, addCookie, addWindowListener, clearContents, clearProxyServer, getClientProperties, getCookieDetails, getCookieJar, getCookieNames, getCookieValue, getCurrentPage, getExceptionsThrownOnErrorStatus, getFrameContents, getFrameContents, getFrameNames, getHeaderField, getHeaderFields, getMainWindow, getNextAlert, getOpenWindow, getOpenWindows, getProxyHost, getProxyPort, getResource, getResponse, getResponse, getUserAgent, popNextAlert, putCookie, removeClientListener, removeWindowListener, sendRequest, setAuthentication, setAuthorization, setDialogResponder, setExceptionsThrownOnErrorStatus, setHeaderField, setMainWindow, setProxyServer, setUserAgent, updateMainWindow, writeMessageBodypublic static ServletUnitClient newClient(InvocationContextFactory factory)
public void setProxyServer(java.lang.String proxyHost,
int proxyPort)
setProxyServer in class WebClientpublic InvocationContext newInvocation(java.lang.String requestString) throws java.io.IOException, java.net.MalformedURLException
java.io.IOExceptionjava.net.MalformedURLExceptionpublic InvocationContext newInvocation(WebRequest request) throws java.io.IOException, java.net.MalformedURLException
java.io.IOExceptionjava.net.MalformedURLExceptionpublic WebResponse getResponse(InvocationContext invocation) throws java.net.MalformedURLException, java.io.IOException, org.xml.sax.SAXException
java.net.MalformedURLExceptionjava.io.IOExceptionorg.xml.sax.SAXExceptionpublic javax.servlet.http.HttpSession getSession(boolean create)
create - if true, will create a new session if no valid session is defined.protected WebResponse newResponse(WebRequest request, FrameSelector targetFrame) throws java.net.MalformedURLException, java.io.IOException
newResponse in class WebClientrequest - the request to which the response should be generatedtargetFrame - the frame in which the response should be storedjava.net.MalformedURLExceptionjava.io.IOException