Package org.apache.jmeter.assertions
Class SizeAssertion
-
- 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 SizeAssertion extends AbstractScopedAssertion implements Serializable, Assertion
Checks if the results of a Sample matches a particular size.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intEQUALpublic final static intNOTEQUALpublic final static intGREATERTHANpublic final static intLESSTHANpublic final static intGREATERTHANEQUALpublic final static intLESSTHANEQUALpublic transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description SizeAssertion()
-
Method Summary
Modifier and Type Method Description AssertionResultgetResult(SampleResult response)Returns the result of the Assertion. StringgetAllowedSize()Returns the size in bytes to be asserted. voidsetCompOper(int operator)Set the operator used for the assertion. intgetCompOper()Returns the operator to be asserted. voidsetAllowedSize(String size)Set the size that shall be asserted. voidsetAllowedSize(long size)Set the size that should be used in the assertion voidsetTestFieldNetworkSize()voidsetTestFieldResponseHeaders()voidsetTestFieldResponseBody()voidsetTestFieldResponseCode()voidsetTestFieldResponseMessage()StringgetTestField()booleanisTestFieldNetworkSize()booleanisTestFieldResponseHeaders()booleanisTestFieldResponseBody()booleanisTestFieldResponseCode()booleanisTestFieldResponseMessage()-
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
-
-
Method Detail
-
getResult
AssertionResult getResult(SampleResult response)
Returns the result of the Assertion. Here it checks the Sample responseData length.
-
getAllowedSize
String getAllowedSize()
Returns the size in bytes to be asserted.
- Returns:
The allowed size
-
setCompOper
void setCompOper(int operator)
Set the operator used for the assertion. Has to be one of
- EQUAL
- 1
- NOTEQUAL
- 2
- GREATERTHAN
- 3
- LESSTHAN
- 4
- GREATERTHANEQUAL
- 5
- LESSTHANEQUAL
- 6
- Parameters:
operator- The operator to be used in the assertion
-
getCompOper
int getCompOper()
Returns the operator to be asserted.
- EQUAL
- 1
- NOTEQUAL
- 2
- GREATERTHAN
- 3
- LESSTHAN
- 4
- GREATERTHANEQUAL
- 5
- LESSTHANEQUAL
- 6
- Returns:
The operator used for the assertion
-
setAllowedSize
void setAllowedSize(String size)
Set the size that shall be asserted.
- Parameters:
size- a number of bytes.
-
setAllowedSize
void setAllowedSize(long size)
Set the size that should be used in the assertion
- Parameters:
size- The number of bytes
-
setTestFieldNetworkSize
void setTestFieldNetworkSize()
-
setTestFieldResponseHeaders
void setTestFieldResponseHeaders()
-
setTestFieldResponseBody
void setTestFieldResponseBody()
-
setTestFieldResponseCode
void setTestFieldResponseCode()
-
setTestFieldResponseMessage
void setTestFieldResponseMessage()
-
getTestField
String getTestField()
-
isTestFieldNetworkSize
boolean isTestFieldNetworkSize()
-
isTestFieldResponseHeaders
boolean isTestFieldResponseHeaders()
-
isTestFieldResponseBody
boolean isTestFieldResponseBody()
-
isTestFieldResponseCode
boolean isTestFieldResponseCode()
-
isTestFieldResponseMessage
boolean isTestFieldResponseMessage()
-
-
-
-