Class JavaTest

All Implemented Interfaces:
Serializable, JavaSamplerClient, Interruptible

@AutoService(JavaSamplerClient.class) public class JavaTest extends AbstractJavaSamplerClient implements Serializable, Interruptible
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 status

 
The elapsed time and end-time cannot be directly controlled.

Note: this class was derived from SleepTest.

See Also:
  • Field Details

    • DEFAULT_SLEEP_TIME

      public static final long DEFAULT_SLEEP_TIME
      The default value of the SleepTime parameter, in milliseconds.
      See Also:
    • DEFAULT_SLEEP_MASK

      public static final long DEFAULT_SLEEP_MASK
      The default value of the SleepMask parameter.
      See Also:
  • Constructor Details

    • JavaTest

      public JavaTest()
      Default constructor for JavaTest. The Java Sampler uses the default constructor to instantiate an instance of the client class.
  • Method Details