Class DurationAssertion

All Implemented Interfaces:
Serializable, Cloneable, Assertion, Searchable, org.apache.jmeter.testelement.TestElement

public class DurationAssertion extends AbstractScopedAssertion implements Serializable, Assertion
Checks if an Sample is sampled within a specified time-frame. If the duration is larger than the timeframe the Assertion is considered a failure.
See Also:
  • Field Details

    • DURATION_KEY

      public static final String DURATION_KEY
      Key for storing assertion-information in the jmx-file.
      See Also:
  • Constructor Details

    • DurationAssertion

      public DurationAssertion()
  • Method Details

    • getResult

      public AssertionResult getResult(SampleResult response)
      Returns the result of the Assertion. Here it checks whether the Sample took to long to be considered successful. If so an AssertionResult containing a FailureMessage will be returned. Otherwise the returned AssertionResult will reflect the success of the Sample.
      Specified by:
      getResult in interface Assertion
      Parameters:
      response - the SampleResult containing information about the Sample (duration, success, etc)
      Returns:
      the AssertionResult containing the information about whether the assertion passed or failed.
    • setAllowedDuration

      public void setAllowedDuration(long duration)
      Set duration
      Parameters:
      duration - Duration in millis