|
Apache JMeter | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.config.ConfigTestElement
org.apache.jmeter.protocol.http.control.AuthManager
public class AuthManager
This class provides a way to provide Authorization in jmeter requests. The format of the authorization file is: URL user pass where URL is an HTTP URL, user a username to use and pass the appropriate password.
| Nested Class Summary | |
|---|---|
static class |
AuthManager.Mechanism
|
| Field Summary | |
|---|---|
static int |
COL_DOMAIN
|
static int |
COL_MECHANISM
|
static int |
COL_PASSWORD
|
static int |
COL_REALM
|
static int |
COL_URL
|
static int |
COL_USERNAME
|
| Fields inherited from class org.apache.jmeter.config.ConfigTestElement |
|---|
PASSWORD, USERNAME |
| Fields inherited from interface org.apache.jmeter.testelement.TestElement |
|---|
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS |
| Constructor Summary | |
|---|---|
AuthManager()
Default Constructor. |
|
| Method Summary | |
|---|---|
void |
addAuth()
|
void |
addAuth(Authorization auth)
|
void |
addConfigElement(ConfigElement config)
Add a configuration element to this one. |
void |
addFile(String authFile)
Add authentication data from a file. |
void |
clear()
Clear the TestElement of all data. |
boolean |
expectsModification()
If your config element expects to be modified in the process of a test run, and you want those modifications to carry over from sample to sample (as in a cookie manager - you want to save all cookies that get set throughout the test), then return true for this method. |
Authorization |
get(int i)
Return the record at index i |
int |
getAuthCount()
Return the number of records. |
Authorization |
getAuthForURL(URL url)
|
String |
getAuthHeaderForURL(URL url)
|
Authorization |
getAuthObjectAt(int row)
|
CollectionProperty |
getAuthObjects()
|
boolean |
getClearEachIteration()
|
Class<?> |
getColumnClass(int column)
|
int |
getColumnCount()
|
String |
getColumnName(int column)
|
Subject |
getSubjectForUrl(URL url)
|
boolean |
hasAuthForURL(URL url)
|
boolean |
isEditable()
|
void |
remove(int index)
Remove an authentication record. |
void |
save(String authFile)
Save the authentication data to a file. |
void |
set(int index,
String url,
String user,
String pass,
String domain,
String realm,
AuthManager.Mechanism mechanism)
Update an authentication record. |
void |
setClearEachIteration(boolean clear)
|
void |
setupCredentials(org.apache.http.client.HttpClient client,
URL url,
org.apache.http.client.CredentialsProvider credentialsProvider,
String localHost)
Configure credentials and auth scheme on client if an authorization is available for url |
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. |
| Methods inherited from class org.apache.jmeter.config.ConfigTestElement |
|---|
addTestElement |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.jmeter.config.ConfigElement |
|---|
clone |
| Field Detail |
|---|
public static final int COL_URL
public static final int COL_USERNAME
public static final int COL_PASSWORD
public static final int COL_DOMAIN
public static final int COL_REALM
public static final int COL_MECHANISM
| Constructor Detail |
|---|
public AuthManager()
| Method Detail |
|---|
public void clear()
clear in interface TestElementclear in class AbstractTestElement
public void set(int index,
String url,
String user,
String pass,
String domain,
String realm,
AuthManager.Mechanism mechanism)
public CollectionProperty getAuthObjects()
public int getColumnCount()
public String getColumnName(int column)
public Class<?> getColumnClass(int column)
public Authorization getAuthObjectAt(int row)
public boolean isEditable()
public Authorization get(int i)
public String getAuthHeaderForURL(URL url)
public Authorization getAuthForURL(URL url)
public boolean hasAuthForURL(URL url)
public Subject getSubjectForUrl(URL url)
public void addConfigElement(ConfigElement config)
addConfigElement in interface ConfigElementaddConfigElement in class ConfigTestElementconfig - the element to be added to this ConfigElementpublic void addAuth(Authorization auth)
public void addAuth()
public boolean expectsModification()
expectsModification in interface ConfigElementexpectsModification in class ConfigTestElement
public void save(String authFile)
throws IOException
IOException
public void addFile(String authFile)
throws IOException
IOExceptionpublic void remove(int index)
public boolean getClearEachIteration()
public void setClearEachIteration(boolean clear)
public int getAuthCount()
public void setupCredentials(org.apache.http.client.HttpClient client,
URL url,
org.apache.http.client.CredentialsProvider credentialsProvider,
String localHost)
client - HttpClienturl - URL to testcredentialsProvider - CredentialsProviderlocalHost - host running JMeterpublic 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 TestStateListenerStandardJMeterEngine.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 TestStateListenerStandardJMeterEngine.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 TestStateListenerhost - 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 TestStateListenerhost - name of hostStandardJMeterEngine.stopTest()public void testIterationStart(LoopIterationEvent event)
testIterationStart in interface TestIterationListener
|
Apache JMeter | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||