Class DurationAssertion

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.assertions.Assertion , org.apache.jmeter.gui.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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      AssertionResult getResult(SampleResult response) Returns the result of the Assertion.
      void setAllowedDuration(long duration) Set duration
      • Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

        addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
      • Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement

        fetchScope, getProps, getSchema, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable
      • Methods inherited from class org.apache.jmeter.testelement.TestElement

        get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DurationAssertion

        DurationAssertion()
    • Method Detail

      • getResult

         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.

      • setAllowedDuration

         void setAllowedDuration(long duration)

        Set duration

        Parameters:
        duration - Duration in millis