|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WEnvironment
eu.webtoolkit.jwt.WTestEnvironment
public class WTestEnvironment
An environment for testing purposes
This environment is useful for use in unit tests: you may configure its properties and pass it to the constructor of an application.
This is useful for (unit) test-cases:
void testX() {
WTestEnvironment environment(new Configuration());
MyApplication app(environment);
...
}
WEnvironment,
WApplication.WApplication(WEnvironment env)| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WEnvironment |
|---|
WEnvironment.ContentType |
| Constructor Summary | |
|---|---|
WTestEnvironment(Configuration configuration)
Default constructor. |
|
WTestEnvironment(Configuration configuration,
EntryPointType type)
Default constructor. |
|
| Method Summary | |
|---|---|
void |
setAccept(java.lang.String accept)
Sets the accept header. |
void |
setAjax(boolean enabled)
Sets whether AJAX is supported. |
void |
setClientAddress(java.lang.String clientAddress)
Sets the client address. |
void |
setContentType(WEnvironment.ContentType contentType)
Sets the content type. |
void |
setCookies(java.util.Map<java.lang.String,java.lang.String> cookies)
Sets HTTP cookies. |
void |
setDpiScale(double dpiScale)
Sets the display's DPI scale. |
void |
setHeaderValue(java.lang.String value)
Sets a HTTP header value. |
void |
setHostName(java.lang.String hostName)
Sets the host name. |
void |
setInternalPath(java.lang.String internalPath)
Sets the initial internal path. |
void |
setLocale(java.util.Locale locale)
Sets the locale. |
void |
setParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
Sets parameters to the application. |
void |
setReferer(java.lang.String referer)
Sets the referer. |
void |
setServerAdmin(java.lang.String serverAdmin)
Sets the server admin. |
void |
setServerSignature(java.lang.String signature)
Sets the server signature. |
void |
setServerSoftware(java.lang.String software)
Sets the server software. |
void |
setSupportsCookies(boolean enabled)
Sets whether cookies are supported. |
void |
setUrlScheme(java.lang.String scheme)
Sets the URL scheme. |
| Methods inherited from class eu.webtoolkit.jwt.WEnvironment |
|---|
agentIsSpiderBot, getAccept, getCgiValue, getClientAddress, getContentType, getCookie, getCookies, getDeploymentPath, getDpiScale, getHeaderValue, getHostName, getInternalPath, getJavaScriptWtScope, getLibraryVersion, getLocale, getParameter, getParameterMap, getParameterValues, getReferer, getServerAdmin, getServerSignature, getServerSoftware, getSessionId, getUrlScheme, getUserAgent, hasAjax, hasJavaScript, supportsCookies |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WTestEnvironment(Configuration configuration,
EntryPointType type)
Constructs a test environment that resembles FireFox 3.0 with default settings.
After construction, but before passing it to the constructor of a
WApplication, you can change any of the environment properties
using the setter methods.
public WTestEnvironment(Configuration configuration)
Calls
this(configuration, EntryPointType.Application)
| Method Detail |
|---|
public void setParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters)
The default value is an empty map.
WEnvironment.getParameterMap()public void setCookies(java.util.Map<java.lang.String,java.lang.String> cookies)
The default value is an empty map.
WEnvironment.getCookies()public void setHeaderValue(java.lang.String value)
The default value is no headers.
WEnvironment.getHeaderValue(String name)public void setSupportsCookies(boolean enabled)
The default value is true.
WEnvironment.supportsCookies()public void setAjax(boolean enabled)
The default value is true.
WEnvironment.hasAjax()public void setDpiScale(double dpiScale)
The default value is 1.
WEnvironment.getDpiScale()public void setLocale(java.util.Locale locale)
The default value is "en".
WEnvironment.getLocale()public void setHostName(java.lang.String hostName)
The default value is "localhost".
WEnvironment.getHostName()public void setUrlScheme(java.lang.String scheme)
The default value is "http".
WEnvironment.getUrlScheme()public void setReferer(java.lang.String referer)
The default value is "".
WEnvironment.getReferer()public void setAccept(java.lang.String accept)
The default value is "text/html,application/xhtml+xml,application/xml;q=0.9,* /*;q=0.8".
WEnvironment.getAccept()public void setServerSignature(java.lang.String signature)
The default value is "None (WTestEnvironment)".
WEnvironment.getServerSignature()public void setServerSoftware(java.lang.String software)
The default value is "None (WTestEnvironment)".
WEnvironment.getServerSoftware()public void setServerAdmin(java.lang.String serverAdmin)
The default value is "your@onyourown.here".
WEnvironment.getServerAdmin()public void setClientAddress(java.lang.String clientAddress)
The default value is "127.0.0.1".
WEnvironment.getClientAddress()public void setInternalPath(java.lang.String internalPath)
The default value is "".
WEnvironment.getInternalPath()public void setContentType(WEnvironment.ContentType contentType)
The default value is XHTML1.
WEnvironment.getContentType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||