Class AssertionResult

  • All Implemented Interfaces:
    java.io.Serializable , org.apache.jmeter.gui.Searchable

    
    public class AssertionResult
     implements Serializable, Searchable
                        

    Implements Response Assertion checking.

    • 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
      String getName() Get the name of the assertion
      String getFailureMessage() Get the message associated with any failure or error.
      void setFailureMessage(String message) Set the failure message giving more details about a failure or error.
      boolean isFailure() Check if the assertion failed.
      boolean isError() Check if an error occurred while checking the assertion.
      AssertionResult setResultForFailure(String message) Convenience method for setting up failed results
      AssertionResult setResultForNull() Convenience method for setting up results where the response was null
      String toString()
      List<String> getSearchableTokens() Get a list of all tokens that should be visible to searching
      void setError(boolean e) Set the flag indicating whether or not an error occurred while evaluating assertion failure clause.
      void setFailure(boolean f) Set the flag indicating whether or not a failure occurred.
      • Methods inherited from class java.lang.Object

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

      • AssertionResult

        AssertionResult()
        Create a new Assertion Result.
      • AssertionResult

        AssertionResult(String name)
        Create a new Assertion Result.
        Parameters:
        name - the name of the assertion
    • Method Detail

      • getName

         String getName()

        Get the name of the assertion

        Returns:

        the name of the assertion

      • getFailureMessage

         String getFailureMessage()

        Get the message associated with any failure or error. This method may return null if no message was set.

        Returns:

        a failure or error message, or null if no message has been set

      • setFailureMessage

         void setFailureMessage(String message)

        Set the failure message giving more details about a failure or error.

        Parameters:
        message - the message to set
      • isFailure

         boolean isFailure()

        Check if the assertion failed. If it failed, the failure message may give more details about the failure.

        Returns:

        true if the assertion failed, false if the sample met the assertion criteria

      • isError

         boolean isError()

        Check if an error occurred while checking the assertion. If an error occurred, the failure message may give more details about the error.

        Returns:

        true if an error occurred while checking the assertion, false otherwise.

      • setResultForNull

         AssertionResult setResultForNull()

        Convenience method for setting up results where the response was null

        Returns:

        assertion result with appropriate fields set up

      • getSearchableTokens

         List<String> getSearchableTokens()

        Get a list of all tokens that should be visible to searching

        Returns:

        List of searchable tokens

      • setError

         void setError(boolean e)

        Set the flag indicating whether or not an error occurred while evaluating assertion failure clause.

        Parameters:
        e - true if an error occurred, false otherwise
      • setFailure

         void setFailure(boolean f)

        Set the flag indicating whether or not a failure occurred.

        Parameters:
        f - true if a failure occurred, false otherwise