Interface TestableRequest
-
- All Superinterfaces:
Request
- All Known Implementing Classes:
TestableRequestImpl
public interface TestableRequest extends Request
An extended version ofRequest
that allows thePageTester
to control and override behavior, effectively simulating the portions ofRequest
that are provided normally by a servlet container.
-
-
Field Summary
-
Fields inherited from interface org.apache.tapestry5.http.services.Request
REQUESTED_WITH_HEADER, X_FORWARDED_PROTO_HEADER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TestableRequest
clear()
Clears the internal parameters map.TestableRequest
loadParameter(java.lang.String parameterName, java.lang.String parameterValue)
Loads a single parameter/value pair.TestableRequest
overrideParameter(java.lang.String parameterName, java.lang.String parameterValue)
Overrides a parameter to the specific value, regardless of how the parameter was previously set.TestableRequest
setLocale(java.util.Locale locale)
Sets the locale requested by "the browser".TestableRequest
setPath(java.lang.String path)
Sets the path; the path should begin with a "/" character and contain everything from there to the start of query parameters (if any).-
Methods inherited from interface org.apache.tapestry5.http.services.Request
getAttribute, getAttributeNames, getContextPath, getDateHeader, getHeader, getHeaderNames, getLocale, getLocalPort, getMethod, getParameter, getParameterNames, getParameters, getPath, getRemoteHost, getServerName, getServerPort, getSession, isRequestedSessionIdValid, isSecure, isSessionInvalidated, isXHR, setAttribute
-
-
-
-
Method Detail
-
clear
TestableRequest clear()
Clears the internal parameters map.- Returns:
- the request for further configuration
-
setPath
TestableRequest setPath(java.lang.String path)
Sets the path; the path should begin with a "/" character and contain everything from there to the start of query parameters (if any).- Parameters:
path
-- Returns:
- the request for further configuration
-
setLocale
TestableRequest setLocale(java.util.Locale locale)
Sets the locale requested by "the browser".- Returns:
- the request for further configuration
-
loadParameter
TestableRequest loadParameter(java.lang.String parameterName, java.lang.String parameterValue)
Loads a single parameter/value pair. This may define a new parameter, or add a value to a list of parameters.- Returns:
- the request for further configuration
-
overrideParameter
TestableRequest overrideParameter(java.lang.String parameterName, java.lang.String parameterValue)
Overrides a parameter to the specific value, regardless of how the parameter was previously set.
-
-