Package org.apache.jmeter.assertions
Class AssertionResult
java.lang.Object
org.apache.jmeter.assertions.AssertionResult
- All Implemented Interfaces:
- Serializable,- Searchable
- Direct Known Subclasses:
- CompareAssertionResult
Implements Response Assertion checking.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.- use the named constructorAssertionResult(String name) Create a new Assertion Result.
- 
Method SummaryModifier and TypeMethodDescriptionGet the message associated with any failure or error.getName()Get the name of the assertionGet a list of all tokens that should be visible to searchingbooleanisError()Check if an error occurred while checking the assertion.booleanCheck if the assertion failed.voidsetError(boolean e) Set the flag indicating whether or not an error occurred while evaluating assertion failure clause.voidsetFailure(boolean f) Set the flag indicating whether or not a failure occurred.voidsetFailureMessage(String message) Set the failure message giving more details about a failure or error.setResultForFailure(String message) Convenience method for setting up failed resultsConvenience method for setting up results where the response was nulltoString()
- 
Field Details- 
RESPONSE_WAS_NULL- See Also:
 
 
- 
- 
Constructor Details- 
AssertionResultDeprecated.- use the named constructorCreate a new Assertion Result. The result will indicate no failure or error.
- 
AssertionResultCreate a new Assertion Result. The result will indicate no failure or error.- Parameters:
- name- the name of the assertion
 
 
- 
- 
Method Details- 
getNameGet the name of the assertion- Returns:
- the name of the assertion
 
- 
isFailurepublic 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
 
- 
isErrorpublic 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.
 
- 
getFailureMessageGet 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
 
- 
setErrorpublic 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
 
- 
setFailurepublic void setFailure(boolean f) Set the flag indicating whether or not a failure occurred.- Parameters:
- f- true if a failure occurred, false otherwise
 
- 
setFailureMessageSet the failure message giving more details about a failure or error.- Parameters:
- message- the message to set
 
- 
setResultForFailureConvenience method for setting up failed results- Parameters:
- message- the message to set
- Returns:
- this
 
- 
setResultForNullConvenience method for setting up results where the response was null- Returns:
- assertion result with appropriate fields set up
 
- 
toString
- 
getSearchableTokensDescription copied from interface:SearchableGet a list of all tokens that should be visible to searching- Specified by:
- getSearchableTokensin interface- Searchable
- Returns:
- List of searchable tokens
- Throws:
- Exception- when something fails while getting the searchable tokens
 
 
-