|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jwebunit.TestContext
Establish context for tests (things such as locale, base url for the
application, cookies, authorization). The context can be accessed through the
WebTestCase
or WebTester
.
Constructor Summary | |
TestContext()
Construct a test client context. |
Method Summary | |
void |
addCookie(java.lang.String name,
java.lang.String value)
Add a cookie to the test context. |
java.lang.String |
getBaseUrl()
Return the base URL for the test context. |
java.util.List |
getCookies()
Return the cookies which have been added to the test context. |
java.lang.String |
getEncodingScheme()
Return the encoding scheme for the test context. |
java.util.Locale |
getLocale()
Return the locale established for the test context. |
java.lang.String |
getPassword()
Return the user password. |
java.lang.String |
getResourceBundleName()
Return the test context resource bundle for expected value lookups. |
java.lang.String |
getUser()
Return the authorized user for the test context. |
boolean |
hasAuthorization()
Return true if a user / password has been set on the context via setAuthorization(java.lang.String, java.lang.String) . |
boolean |
hasCookies()
Return true if one or more cookies have been added to the test context. |
void |
setAuthorization(java.lang.String user,
java.lang.String passwd)
Set authentication information for the test context. |
void |
setBaseUrl(java.lang.String url)
Set the base url for the test context. |
void |
setEncodingScheme(java.lang.String encodingScheme)
Set the encoding scheme for the test context which is applied to response text. |
void |
setLocale(java.util.Locale locale)
Set the locale for the test context. |
void |
setResourceBundleName(java.lang.String name)
Set a resource bundle to use for the test context (will be used to lookup expected values by key in WebTester). |
java.lang.String |
toEncodedString(java.lang.String text)
Return the value of a String in the encoding specified by the test context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TestContext()
Method Detail |
public void setAuthorization(java.lang.String user, java.lang.String passwd)
HttpUnitDialog
to set authorization on the WebConversation
when the dialog is begun.user
- user namepasswd
- passwordpublic void addCookie(java.lang.String name, java.lang.String value)
HttpUnitDialog
is begun.name
- cookie name.value
- cookie value.public boolean hasAuthorization()
setAuthorization(java.lang.String, java.lang.String)
.public boolean hasCookies()
public java.lang.String getUser()
public java.lang.String getPassword()
public java.util.List getCookies()
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public java.lang.String getEncodingScheme()
public void setEncodingScheme(java.lang.String encodingScheme)
public java.lang.String toEncodedString(java.lang.String text)
text
- input text.public void setResourceBundleName(java.lang.String name)
name
- path name of the resource bundle.public java.lang.String getResourceBundleName()
public java.lang.String getBaseUrl()
public void setBaseUrl(java.lang.String url)
url
- Base url value - A trailing "/" is appended if not provided.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |