org.apache.jmeter.protocol.http.control
public class CookieManager extends ConfigTestElement implements TestListener, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_POLICY |
PASSWORD, USERNAME
COMMENTS, 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, expectsModification
addProperty, 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, traverseProperty
public static final String DEFAULT_POLICY
public Object clone()
clone
in interface ConfigElement
clone
in interface TestElement
clone
in class AbstractTestElement
public 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
IOException
public void addFile(String cookieFile) throws IOException
IOException
public void recoverRunningVersion()
recoverRunningVersion
in interface TestElement
recoverRunningVersion
in class AbstractTestElement
public void setRunningVersion(boolean running)
setRunningVersion
in interface TestElement
setRunningVersion
in class AbstractTestElement
running
- the runningVersion to setpublic void add(Cookie c)
public void clear()
clear
in interface TestElement
clear
in class AbstractTestElement
public 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 TestListener
StandardJMeterEngine.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 TestListener
StandardJMeterEngine.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 TestListener
host
- 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 TestListener
host
- name of hostStandardJMeterEngine.stopTest()
public void testIterationStart(LoopIterationEvent event)
testIterationStart
in interface TestListener
public static String[] getCookieSpecs()
Copyright © 1998-2014 Apache Software Foundation. All Rights Reserved.