|
Apache JMeter 2.0.1.20050615 |
|||||||||
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.samplers.AbstractSampler
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase
Common constants and methods for HTTP samplers
Field Summary | |
static String |
ARGUMENTS
|
static String |
AUTH_MANAGER
|
static String |
AUTO_REDIRECTS
|
static String |
CONTENT_TYPE
|
static String |
COOKIE_MANAGER
|
static int |
DEFAULT_HTTP_PORT
|
static int |
DEFAULT_HTTPS_PORT
|
static String |
DEFAULT_PROTOCOL
|
static String |
DOMAIN
|
static String |
FILE_DATA
|
static String |
FILE_FIELD
|
static String |
FILE_MIMETYPE
|
static String |
FILE_NAME
|
static String |
FOLLOW_REDIRECTS
|
static String |
GET
|
static String |
HEADER_MANAGER
|
static String |
IMAGE_PARSER
|
protected static int |
MAX_FRAME_DEPTH
|
protected static int |
MAX_REDIRECTS
|
static String |
METHOD
|
static String |
MIMETYPE
|
static String |
MONITOR
|
static String |
MULTIPART_FORM
|
protected static String |
NON_HTTP_RESPONSE_CODE
|
protected static String |
NON_HTTP_RESPONSE_MESSAGE
|
static String |
NORMAL_FORM
|
static String |
PATH
|
static String |
PORT
|
static String |
POST
|
static String |
PROTOCOL
|
static int |
UNSPECIFIED_PORT
A number to indicate that the port has not been set. |
static String |
URL
|
static String |
USE_KEEPALIVE
|
Fields inherited from interface org.apache.jmeter.testelement.TestElement |
ENABLED, GUI_CLASS, NAME, TEST_CLASS |
Constructor Summary | |
HTTPSamplerBase()
|
Method Summary | |
void |
addArgument(String name,
String value)
|
void |
addArgument(String name,
String value,
String metadata)
|
void |
addEncodedArgument(String name,
String value,
String metaData)
|
void |
addTestElement(TestElement el)
|
Object |
clone()
|
protected HTTPSampleResult |
downloadPageResources(HTTPSampleResult res,
boolean createContainerResult,
int frameDepth)
Download the resources of an HTML page. |
protected String |
encodeSpaces(String path)
|
protected HTTPSampleResult |
errorResult(Throwable e,
String data,
long time)
Obtain a result that will help inform the user that an error has occured during sampling, and how long it took to detect the error. |
Arguments |
getArguments()
|
AuthManager |
getAuthManager()
|
CookieManager |
getCookieManager()
|
String |
getDomain()
|
String |
getFileField()
|
String |
getFilename()
|
boolean |
getFollowRedirects()
|
HeaderManager |
getHeaderManager()
|
String |
getMethod()
|
String |
getMimetype()
|
String |
getMonitor()
|
String |
getPath()
|
int |
getPort()
|
String |
getProtocol()
|
String |
getQueryString()
Gets the QueryString attribute of the UrlConfig object. |
URL |
getUrl()
Get the URL, built from its component parts. |
boolean |
getUseKeepAlive()
|
boolean |
isImageParser()
|
boolean |
isMonitor()
|
void |
parseArguments(String queryString)
This method allows a proxy server to send over the raw text from a browser's output stream to be parsed and stored correctly into the UrlConfig object. |
SampleResult |
sample()
Perform a sample, and return the results |
SampleResult |
sample(Entry e)
Do a sampling and return its results. |
protected abstract HTTPSampleResult |
sample(URL u,
String s,
boolean b,
int i)
|
void |
setArguments(Arguments value)
|
void |
setAuthManager(AuthManager value)
|
void |
setCookieManager(CookieManager value)
|
void |
setDomain(String value)
|
void |
setFileField(String value)
|
void |
setFilename(String value)
|
void |
setFollowRedirects(boolean value)
|
void |
setHeaderManager(HeaderManager value)
|
void |
setImageParser(boolean parseImages)
|
void |
setMethod(String value)
|
void |
setMimetype(String value)
|
void |
setMonitor(String value)
|
void |
setPath(String path)
Sets the Path attribute of the UrlConfig object Also calls parseArguments to extract and store any query arguments |
void |
setPort(int value)
|
void |
setProtocol(String value)
|
void |
setUseKeepAlive(boolean value)
|
void |
testEnded()
Called once for all threads after the end of a test |
void |
testEnded(String host)
|
void |
testIterationStart(LoopIterationEvent event)
Each time through a Thread Group's test script, an iteration event is fired. |
void |
testStarted()
Called just before the start of the test Note that not all the test variables will have been set up at this point. |
void |
testStarted(String host)
|
String |
toString()
|
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement |
addProperty, canRemove, clear, clearTemporary, emptyTemporary, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isRunningVersion, isTemporary, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse, traverseCollection, traverseMap, traverseProperty |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jmeter.testelement.TestElement |
canRemove, clear, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse |
Field Detail |
public static final int DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTP_PORT
public static final String ARGUMENTS
public static final String AUTH_MANAGER
public static final String COOKIE_MANAGER
public static final String HEADER_MANAGER
public static final String MIMETYPE
public static final String DOMAIN
public static final String PORT
public static final String METHOD
public static final String PATH
public static final String FOLLOW_REDIRECTS
public static final String AUTO_REDIRECTS
public static final String PROTOCOL
public static final String DEFAULT_PROTOCOL
public static final String URL
public static final String POST
public static final String GET
public static final String USE_KEEPALIVE
public static final String FILE_NAME
public static final String FILE_FIELD
public static final String FILE_DATA
public static final String FILE_MIMETYPE
public static final String CONTENT_TYPE
public static final String NORMAL_FORM
public static final String MULTIPART_FORM
public static final String IMAGE_PARSER
public static final String MONITOR
public static final int UNSPECIFIED_PORT
protected static final String NON_HTTP_RESPONSE_CODE
protected static final String NON_HTTP_RESPONSE_MESSAGE
protected static final int MAX_REDIRECTS
protected static final int MAX_FRAME_DEPTH
Constructor Detail |
public HTTPSamplerBase()
Method Detail |
public void setFileField(String value)
public String getFileField()
public void setFilename(String value)
public String getFilename()
public void setProtocol(String value)
public String getProtocol()
public void setPath(String path)
path
- The new Path valuepublic String getPath()
public void setFollowRedirects(boolean value)
public boolean getFollowRedirects()
public void setMethod(String value)
public String getMethod()
public void setUseKeepAlive(boolean value)
public boolean getUseKeepAlive()
public void setMonitor(String value)
public String getMonitor()
public boolean isMonitor()
public void addEncodedArgument(String name, String value, String metaData)
public void addArgument(String name, String value)
public void addArgument(String name, String value, String metadata)
public void addTestElement(TestElement el)
addTestElement
in interface TestElement
addTestElement
in class AbstractTestElement
public void setPort(int value)
public int getPort()
public void setDomain(String value)
public String getDomain()
public void setArguments(Arguments value)
public Arguments getArguments()
public void setAuthManager(AuthManager value)
public AuthManager getAuthManager()
public void setHeaderManager(HeaderManager value)
public HeaderManager getHeaderManager()
public void setCookieManager(CookieManager value)
public CookieManager getCookieManager()
public void setMimetype(String value)
public String getMimetype()
public boolean isImageParser()
public void setImageParser(boolean parseImages)
protected HTTPSampleResult errorResult(Throwable e, String data, long time)
e
- Exception representing the error.data
- a piece of data associated to the error (e.g. URL)time
- time spent detecting the error (0 for client-only issues)
public URL getUrl() throws MalformedURLException
MalformedURLException
public String getQueryString()
public void parseArguments(String queryString)
queryString
- - the query stringpublic String toString()
public SampleResult sample(Entry e)
sample
in interface Sampler
e
- Entry
to be sampled
public SampleResult sample()
protected abstract HTTPSampleResult sample(URL u, String s, boolean b, int i)
protected HTTPSampleResult downloadPageResources(HTTPSampleResult res, boolean createContainerResult, int frameDepth)
If createContainerResult is true, the returned result will contain one subsample for each request issued, including the original one that was passed in. It will otherwise look exactly like that original one.
If createContainerResult is false, one subsample will be added to the provided result for each requests issued.
res
- result of the initial request - must contain an HTML
responsecreateContainerResult
- whether to create a "container" or just
use the provided res
for that purposeframeDepth
- Depth of this target in the frame structure.
Used only to prevent infinite recursion.
protected String encodeSpaces(String path)
public void testEnded()
TestListener
testEnded
in interface TestListener
StandardJMeterEngine.stopTest()
public void testEnded(String host)
testEnded
in interface TestListener
public void testIterationStart(LoopIterationEvent event)
TestListener
testIterationStart
in interface TestListener
event
- public void testStarted()
TestListener
testStarted
in interface TestListener
StandardJMeterEngine.run()
public void testStarted(String host)
testStarted
in interface TestListener
public Object clone()
clone
in interface TestElement
clone
in class AbstractTestElement
|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |