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(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(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(String proxyHost, int proxyPort)
setProxyServer in class WebClientpublic InvocationContext newInvocation(String requestString) throws IOException, MalformedURLException
IOExceptionMalformedURLExceptionpublic InvocationContext newInvocation(WebRequest request) throws IOException, MalformedURLException
IOExceptionMalformedURLExceptionpublic WebResponse getResponse(InvocationContext invocation) throws MalformedURLException, IOException, SAXException
public 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 MalformedURLException, IOException
newResponse in class WebClientrequest - the request to which the response should be generatedtargetFrame - the frame in which the response should be storedMalformedURLExceptionIOExceptionCopyright © 2012. All Rights Reserved.