public class CookieManager extends ConfigTestElement implements TestListener, Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_POLICY |
PASSWORD, USERNAMECOMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS| Constructor and Description |
|---|
CookieManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Cookie c)
Add a cookie.
|
void |
addCookieFromHeader(String cookieHeader,
URL url) |
void |
addFile(String cookieFile)
Add cookie data from a file.
|
void |
clear()
Clear the TestElement of all data.
|
Object |
clone() |
Cookie |
get(int i)
Return the cookie at index i.
|
boolean |
getClearEachIteration() |
int |
getCookieCount() |
String |
getCookieHeaderForURL(URL url)
Find cookies applicable to the given URL and build the Cookie header from
them.
|
CollectionProperty |
getCookies() |
org.apache.commons.httpclient.Cookie[] |
getCookiesForUrl(URL url)
Get array of valid HttpClient cookies for the URL
|
static String[] |
getCookieSpecs() |
String |
getPolicy() |
void |
recoverRunningVersion()
Tells the test element to return to the state it was in when
makeRunningVersion() was called.
|
void |
remove(int index)
Remove a cookie.
|
void |
save(String authFile)
Save the static cookie data to a file.
|
void |
setClearEachIteration(boolean clear) |
void |
setCookiePolicy(String policy) |
void |
setRunningVersion(boolean running)
Sets the runningVersion.
|
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testIterationStart(LoopIterationEvent event)
Each time through a Thread Group's test script, an iteration event is
fired for each thread.
|
void |
testStarted()
Called just before the start of the test from the main engine thread.
|
void |
testStarted(String host)
Called just before the start of the test from the main engine thread.
|
addConfigElement, addTestElement, expectsModificationaddProperty, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertypublic static final String DEFAULT_POLICY
public Object clone()
clone in interface ConfigElementclone in interface TestElementclone in class AbstractTestElementpublic String getPolicy()
public void setCookiePolicy(String policy)
public CollectionProperty getCookies()
public int getCookieCount()
public boolean getClearEachIteration()
public void setClearEachIteration(boolean clear)
public void save(String authFile) throws IOException
IOExceptionpublic void addFile(String cookieFile) throws IOException
IOExceptionpublic void recoverRunningVersion()
recoverRunningVersion in interface TestElementrecoverRunningVersion in class AbstractTestElementpublic void setRunningVersion(boolean running)
setRunningVersion in interface TestElementsetRunningVersion in class AbstractTestElementrunning - the runningVersion to setpublic void add(Cookie c)
public void clear()
clear in interface TestElementclear in class AbstractTestElementpublic void remove(int index)
public Cookie get(int i)
public org.apache.commons.httpclient.Cookie[] getCookiesForUrl(URL url)
url - the target URLpublic String getCookieHeaderForURL(URL url)
url - URL of the request to which the returned header will be added.public void testStarted()
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted in interface TestListenerStandardJMeterEngine.run()public void testEnded()
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded in interface TestListenerStandardJMeterEngine.stopTest()public void testStarted(String host)
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted in interface TestListenerhost - name of hostStandardJMeterEngine.run()public void testEnded(String host)
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded in interface TestListenerhost - name of hostStandardJMeterEngine.stopTest()public void testIterationStart(LoopIterationEvent event)
testIterationStart in interface TestListenerpublic static String[] getCookieSpecs()
Copyright © 1998-2012 Apache Software Foundation. All Rights Reserved.