public class TestRequestResponse extends Object implements IRequestResponse
| Constructor and Description |
|---|
TestRequestResponse(TestServerSession session,
IDomUITestInfo info,
String requestURI,
PageParameters parameters) |
TestRequestResponse(TestServerSession session,
IDomUITestInfo info,
String requestURI,
String queryString) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie) |
void |
addHeader(String name,
String value) |
void |
flush() |
String |
getApplicationURL()
Return the base URL to the web application from the current requests.
|
javax.servlet.http.Cookie[] |
getCookies() |
int |
getErrorCode() |
String |
getErrorMessage() |
UploadItem[] |
getFileParameter(String name) |
String[] |
getFileParameters() |
String |
getHostURL() |
String |
getOutputContentType() |
OutputStream |
getOutputStream(String contentType,
String encoding,
int contentLength) |
Writer |
getOutputWriter(String contentType,
String encoding) |
String |
getParameter(String name) |
String[] |
getParameterNames() |
String[] |
getParameters(String name) |
String |
getQueryString() |
String |
getRedirectURL() |
String |
getRemoteUser()
The "remote" user ID from a server request, if present.
|
String |
getRequestURI()
Must return the path part of a request URL.
|
TestResponseType |
getResponseType() |
IServerSession |
getServerSession(boolean create)
Returns a wrapper for a
HttpSession. |
String |
getTextDocument() |
String |
getUserAgent() |
String |
getWebappContext()
Returns the webapp context as either an empty string for the ROOT context or a string starting without a slash and always ending
in one, like "viewpoint/".
|
void |
redirect(String newUrl)
Send a redirect response to the client.
|
void |
releaseUploads()
Called when uploaded files are no longer needed; this can then discard of them.
|
void |
sendError(int httpErrorCode,
String message)
Send an error back to the client.
|
void |
setExpiry(int cacheTime) |
void |
setNoCache() |
void |
setRequestURI(String requestURI) |
public TestRequestResponse(@Nonnull TestServerSession session, @Nonnull IDomUITestInfo info, @Nonnull String requestURI, @Nonnull String queryString)
public TestRequestResponse(@Nonnull TestServerSession session, @Nonnull IDomUITestInfo info, @Nonnull String requestURI, @Nonnull PageParameters parameters)
@Nonnull public String getRequestURI()
IRequestResponsegetRequestURI in interface IRequestResponse@Nonnull public String getQueryString()
getQueryString in interface IRequestResponse@Nonnull public String getUserAgent()
getUserAgent in interface IRequestResponse@Nonnull public String getApplicationURL()
IRequestResponsegetApplicationURL in interface IRequestResponse@Nonnull public String[] getParameters(@Nonnull String name)
getParameters in interface IRequestResponse@Nullable public String getParameter(@Nonnull String name)
getParameter in interface IRequestResponse@Nonnull public String[] getParameterNames()
getParameterNames in interface IRequestResponse@Nonnull public String[] getFileParameters()
getFileParameters in interface IRequestResponse@Nonnull public UploadItem[] getFileParameter(@Nonnull String name)
getFileParameter in interface IRequestResponse@Nonnull public Writer getOutputWriter(@Nonnull String contentType, @Nullable String encoding) throws Exception
getOutputWriter in interface IRequestResponseException@Nonnull public OutputStream getOutputStream(@Nonnull String contentType, @Nullable String encoding, int contentLength) throws Exception
getOutputStream in interface IRequestResponseExceptionpublic void redirect(@Nonnull String newUrl) throws Exception
IRequestResponseredirect in interface IRequestResponseExceptionpublic void sendError(int httpErrorCode,
@Nonnull
String message)
throws Exception
IRequestResponsesendError in interface IRequestResponseException@Nonnull public String getWebappContext()
IRequestResponsegetWebappContext in interface IRequestResponsepublic void addCookie(@Nonnull javax.servlet.http.Cookie cookie)
addCookie in interface IRequestResponse@Nonnull public javax.servlet.http.Cookie[] getCookies()
getCookies in interface IRequestResponsepublic void setExpiry(int cacheTime)
setExpiry in interface IRequestResponsepublic void releaseUploads()
IRequestResponsereleaseUploads in interface IRequestResponsepublic void setNoCache()
setNoCache in interface IRequestResponsepublic void addHeader(@Nonnull String name, @Nonnull String value)
addHeader in interface IRequestResponse@Nonnull public TestResponseType getResponseType()
public int getErrorCode()
@Nonnull public String getHostURL()
getHostURL in interface IRequestResponse@Nullable public String getRemoteUser()
IRequestResponsegetRemoteUser in interface IRequestResponse@Nullable public IServerSession getServerSession(boolean create)
IRequestResponseHttpSession. If "create" is true the session will be
created if it does not exist in which case the call will never return null.getServerSession in interface IRequestResponseCopyright © 2017 etc.to. All rights reserved.