Package org.apache.jmeter.assertions
Class SizeAssertion
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.testelement.AbstractScopedTestElement
org.apache.jmeter.testelement.AbstractScopedAssertion
org.apache.jmeter.assertions.SizeAssertion
- All Implemented Interfaces:
- Serializable,- Cloneable,- Assertion,- Searchable,- org.apache.jmeter.testelement.TestElement
Checks if the results of a Sample matches a particular size.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the size in bytes to be asserted.intReturns the operator to be asserted.getResult(SampleResult response) Returns the result of the Assertion.booleanbooleanbooleanbooleanbooleanvoidsetAllowedSize(long size) Set the size that should be used in the assertionvoidsetAllowedSize(String size) Set the size that shall be asserted.voidsetCompOper(int operator) Set the operator used for the assertion.voidvoidvoidvoidvoidMethods inherited from class org.apache.jmeter.testelement.AbstractScopedAssertiongetScopeNameMethods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElementfetchScope, getProps, getSampleList, getSchema, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariableMethods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
- 
Field Details- 
EQUALpublic static final int EQUAL- See Also:
 
- 
NOTEQUALpublic static final int NOTEQUAL- See Also:
 
- 
GREATERTHANpublic static final int GREATERTHAN- See Also:
 
- 
LESSTHANpublic static final int LESSTHAN- See Also:
 
- 
GREATERTHANEQUALpublic static final int GREATERTHANEQUAL- See Also:
 
- 
LESSTHANEQUALpublic static final int LESSTHANEQUAL- See Also:
 
 
- 
- 
Constructor Details- 
SizeAssertionpublic SizeAssertion()
 
- 
- 
Method Details- 
getResultReturns the result of the Assertion. Here it checks the Sample responseData length.
- 
getAllowedSizeReturns the size in bytes to be asserted.- Returns:
- The allowed size
 
- 
setCompOperpublic 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
 
- 
getCompOperpublic 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
 
- 
setAllowedSizeSet the size that shall be asserted.- Parameters:
- size- a number of bytes.
 
- 
setAllowedSizepublic void setAllowedSize(long size) Set the size that should be used in the assertion- Parameters:
- size- The number of bytes
 
- 
setTestFieldNetworkSizepublic void setTestFieldNetworkSize()
- 
setTestFieldResponseHeaderspublic void setTestFieldResponseHeaders()
- 
setTestFieldResponseBodypublic void setTestFieldResponseBody()
- 
setTestFieldResponseCodepublic void setTestFieldResponseCode()
- 
setTestFieldResponseMessagepublic void setTestFieldResponseMessage()
- 
getTestField
- 
isTestFieldNetworkSizepublic boolean isTestFieldNetworkSize()
- 
isTestFieldResponseHeaderspublic boolean isTestFieldResponseHeaders()
- 
isTestFieldResponseBodypublic boolean isTestFieldResponseBody()
- 
isTestFieldResponseCodepublic boolean isTestFieldResponseCode()
- 
isTestFieldResponseMessagepublic boolean isTestFieldResponseMessage()
 
-