Class CookieManager
- All Implemented Interfaces:
- Serializable,- Cloneable,- ConfigElement,- Searchable,- org.apache.jmeter.testelement.TestElement,- TestIterationListener,- TestStateListener
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from class org.apache.jmeter.config.ConfigTestElementPASSWORD, USERNAMEFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd a cookie.voidaddCookieFromHeader(String cookieHeader, URL url) voidAdd cookie data from a file.voidclear()clone()get(int i) Return the cookie at index i.booleanbooleanintgetCookieHeaderForURL(URL url) Find cookies applicable to the given URL and build the Cookie header from them.voidvoidremove(int index) Remove a cookie.voidSave the static cookie data to a file.voidsetClearEachIteration(boolean clear) voidsetControlledByThread(boolean control) voidsetCookiePolicy(String policy) voidsetImplementation(String implementation) voidsetRunningVersion(boolean running) Sets the runningVersion.voidCalled once for all threads after the end of a test.voidCalled once for all threads after the end of a test.voidEach time through a Thread Group's test script, an iteration event is fired for each thread.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Called just before the start of the test from the main engine thread.Methods inherited from class org.apache.jmeter.config.ConfigTestElementaddConfigElement, addTestElement, expectsModification, getProps, getSchemaMethods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, 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, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
- 
Constructor Details- 
CookieManagerpublic CookieManager()
 
- 
- 
Method Details- 
clone- Specified by:
- clonein interface- ConfigElement
- Specified by:
- clonein interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clonein class- AbstractTestElement
 
- 
getPolicy
- 
setCookiePolicy
- 
getCookies
- 
getCookieCountpublic int getCookieCount()
- 
getClearEachIterationpublic boolean getClearEachIteration()
- 
setClearEachIterationpublic void setClearEachIteration(boolean clear) 
- 
getControlledByThreadpublic boolean getControlledByThread()
- 
setControlledByThreadpublic void setControlledByThread(boolean control) 
- 
getImplementation
- 
setImplementation
- 
saveSave the static cookie data to a file.Cookies are only taken from the GUI - runtime cookies are not included. - Parameters:
- authFile- name of the file to store the cookies into. If the name is relative, the system property- user.dirwill be prepended
- Throws:
- IOException- when writing to that file fails
 
- 
addFileAdd cookie data from a file.- Parameters:
- cookieFile- name of the file to read the cookies from. If the name is relative, the system property- user.dirwill be prepended
- Throws:
- IOException- if reading the file fails
 
- 
recoverRunningVersionpublic void recoverRunningVersion()- Specified by:
- recoverRunningVersionin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- recoverRunningVersionin class- AbstractTestElement
 
- 
setRunningVersionpublic void setRunningVersion(boolean running) Sets the runningVersion.- Specified by:
- setRunningVersionin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- setRunningVersionin class- AbstractTestElement
- Parameters:
- running- the runningVersion to set
 
- 
addAdd a cookie.- Parameters:
- c- cookie to be added
 
- 
clearpublic void clear()- Specified by:
- clearin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clearin class- AbstractTestElement
 
- 
removepublic void remove(int index) Remove a cookie.- Parameters:
- index- index of the cookie to remove
 
- 
getReturn the cookie at index i.- Parameters:
- i- index of the cookie to get
- Returns:
- cookie at index i
 
- 
getCookieHeaderForURLFind cookies applicable to the given URL and build the Cookie header from them.- Parameters:
- url- URL of the request to which the returned header will be added.
- Returns:
- the value string for the cookie header (goes after "Cookie: ").
 
- 
addCookieFromHeader
- 
testStartedpublic 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. - Specified by:
- testStartedin interface- TestStateListener
- See Also:
 
- 
testEndedpublic 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. - Specified by:
- testEndedin interface- TestStateListener
- See Also:
 
- 
testStartedCalled 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. - Specified by:
- testStartedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testEndedCalled 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. - Specified by:
- testEndedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testIterationStartEach time through a Thread Group's test script, an iteration event is fired for each thread. This will be after the test elements have been cloned, so in general the instance will not be the same as the ones the start/end methods call.- Specified by:
- testIterationStartin interface- TestIterationListener
- Parameters:
- event- the iteration event
 
 
-