|
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.protocol.java.sampler.AbstractJavaSamplerClient
org.apache.jmeter.protocol.java.test.JavaTest
The JavaTest
class is a simple sampler which
is intended for use when developing test plans.
The sampler generates results internally,
so does not need access to any external
resources such as web, ftp or LDAP servers.
In addition, because the exact values of most of the SampleResult
can be directly set, it is possible to easily test most Assertions that use
the sample results.
During each sample, this client will sleep for some amount of time. The amount of time to sleep is determined from the two parameters Sleep_Time and Sleep_Mask using the formula:
totalSleepTime = Sleep_Time + (System.currentTimeMillis() % Sleep_Mask)Thus, the Sleep_Mask provides a way to add a random component to the sleep time.
The sampler is able to define the precise values of:
- responseCode - responseMessage - Label - success/fail statusThe elapsed time and end-time cannot be directly controlled.
Note: this class was derived from SleepTest
.
Field Summary | |
static long |
DEFAULT_SLEEP_MASK
The default value of the SleepMask parameter. |
static long |
DEFAULT_SLEEP_TIME
The default value of the SleepTime parameter, in milliseconds. |
Constructor Summary | |
JavaTest()
Default constructor for JavaTest .
|
Method Summary | |
Arguments |
getDefaultParameters()
Provide a list of parameters which this test supports. |
SampleResult |
runTest(JavaSamplerContext context)
Perform a single sample. |
void |
setupTest(JavaSamplerContext context)
Do any initialization required by this client. |
void |
teardownTest(JavaSamplerContext context)
Do any clean-up required by this test. |
Methods inherited from class org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient |
getLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long DEFAULT_SLEEP_TIME
public static final long DEFAULT_SLEEP_MASK
Constructor Detail |
public JavaTest()
JavaTest
.
The Java Sampler uses the default constructor to instantiate
an instance of the client class.
Method Detail |
public void setupTest(JavaSamplerContext context)
setupTest
in interface JavaSamplerClient
setupTest
in class AbstractJavaSamplerClient
context
- the context to run with. This provides access
to initialization parameters.public Arguments getDefaultParameters()
getDefaultParameters
in interface JavaSamplerClient
getDefaultParameters
in class AbstractJavaSamplerClient
public SampleResult runTest(JavaSamplerContext context)
SampleResult
object.
The following fields are always set: - responseCode (default "") - responseMessage (default "") - label (default "JavaTest") - success (default true)The following fields are set from the user-defined parameters, if supplied:
- samplerData - responseData
runTest
in interface JavaSamplerClient
context
- the context to run with. This provides access
to initialization parameters.
SampleResult.sampleStart()
,
SampleResult.sampleEnd()
,
SampleResult.setSuccessful(boolean)
,
SampleResult.setSampleLabel(String)
,
SampleResult.setResponseCode(String)
,
SampleResult.setResponseMessage(String)
,
SampleResult.setResponseData(byte [])
,
SampleResult.setDataType(String)
public void teardownTest(JavaSamplerContext context)
teardownTest
in interface JavaSamplerClient
teardownTest
in class AbstractJavaSamplerClient
context
- the context to run with. This provides access
to initialization parameters.
|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |