public class CookieManager
extends org.apache.jmeter.config.ConfigTestElement
implements org.apache.jmeter.testelement.TestStateListener, org.apache.jmeter.testelement.TestIterationListener, java.io.Serializable
| Constructor and Description |
|---|
CookieManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Cookie c)
Add a cookie.
|
void |
addCookieFromHeader(java.lang.String cookieHeader,
java.net.URL url) |
void |
addFile(java.lang.String cookieFile)
Add cookie data from a file.
|
void |
clear() |
java.lang.Object |
clone() |
Cookie |
get(int i)
Return the cookie at index i.
|
boolean |
getClearEachIteration() |
int |
getCookieCount() |
java.lang.String |
getCookieHeaderForURL(java.net.URL url)
Find cookies applicable to the given URL and build the Cookie header from
them.
|
org.apache.jmeter.testelement.property.CollectionProperty |
getCookies() |
java.lang.String |
getImplementation() |
java.lang.String |
getPolicy() |
void |
recoverRunningVersion() |
void |
remove(int index)
Remove a cookie.
|
void |
save(java.lang.String authFile)
Save the static cookie data to a file.
|
void |
setClearEachIteration(boolean clear) |
void |
setCookiePolicy(java.lang.String policy) |
void |
setImplementation(java.lang.String implementation) |
void |
setRunningVersion(boolean running) |
void |
testEnded() |
void |
testEnded(java.lang.String host) |
void |
testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event) |
void |
testStarted() |
void |
testStarted(java.lang.String host) |
addConfigElement, addTestElement, expectsModificationaddPropertiesValues, addProperty, addProperty, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertypublic java.lang.Object clone()
clone in interface org.apache.jmeter.config.ConfigElementclone in interface org.apache.jmeter.testelement.TestElementclone in class org.apache.jmeter.testelement.AbstractTestElementpublic java.lang.String getPolicy()
public void setCookiePolicy(java.lang.String policy)
public org.apache.jmeter.testelement.property.CollectionProperty getCookies()
public int getCookieCount()
public boolean getClearEachIteration()
public void setClearEachIteration(boolean clear)
public java.lang.String getImplementation()
public void setImplementation(java.lang.String implementation)
public void save(java.lang.String authFile)
throws java.io.IOException
Cookies are only taken from the GUI - runtime cookies are not included.
authFile - name of the file to store the cookies into. If the name is
relative, the system property user.dir will be
prependedjava.io.IOException - when writing to that file failspublic void addFile(java.lang.String cookieFile)
throws java.io.IOException
cookieFile - name of the file to read the cookies from. If the name is
relative, the system property user.dir will be
prependedjava.io.IOException - if reading the file failspublic void recoverRunningVersion()
recoverRunningVersion in interface org.apache.jmeter.testelement.TestElementrecoverRunningVersion in class org.apache.jmeter.testelement.AbstractTestElementpublic void setRunningVersion(boolean running)
setRunningVersion in interface org.apache.jmeter.testelement.TestElementsetRunningVersion in class org.apache.jmeter.testelement.AbstractTestElementpublic void add(Cookie c)
c - cookie to be addedpublic void clear()
clear in interface org.apache.jmeter.testelement.TestElementclear in class org.apache.jmeter.testelement.AbstractTestElementpublic void remove(int index)
index - index of the cookie to removepublic Cookie get(int i)
i - index of the cookie to getipublic java.lang.String getCookieHeaderForURL(java.net.URL url)
url - URL of the request to which the returned header will be added.public void addCookieFromHeader(java.lang.String cookieHeader,
java.net.URL url)
public void testStarted()
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded()
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testStarted(java.lang.String host)
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded(java.lang.String host)
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event)
testIterationStart in interface org.apache.jmeter.testelement.TestIterationListenerCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.