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 Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the size in bytes to be asserted.int
Returns the operator to be asserted.getResult
(SampleResult response) Returns the result of the Assertion.boolean
boolean
boolean
boolean
boolean
void
setAllowedSize
(long size) Set the size that should be used in the assertionvoid
setAllowedSize
(String size) Set the size that shall be asserted.void
setCompOper
(int operator) Set the operator used for the assertion.void
void
void
void
void
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedAssertion
getScopeName
Methods inherited from class org.apache.jmeter.testelement.AbstractScopedTestElement
fetchScope, getProps, getSampleList, getSchema, getVariableName, isScopeAll, isScopeChildren, isScopeParent, isScopeVariable, isScopeVariable, setScopeAll, setScopeChildren, setScopeParent, setScopeVariable
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, 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, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
get, 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
-
EQUAL
public static final int EQUAL- See Also:
-
NOTEQUAL
public static final int NOTEQUAL- See Also:
-
GREATERTHAN
public static final int GREATERTHAN- See Also:
-
LESSTHAN
public static final int LESSTHAN- See Also:
-
GREATERTHANEQUAL
public static final int GREATERTHANEQUAL- See Also:
-
LESSTHANEQUAL
public static final int LESSTHANEQUAL- See Also:
-
-
Constructor Details
-
SizeAssertion
public SizeAssertion()
-
-
Method Details
-
getResult
Returns the result of the Assertion. Here it checks the Sample responseData length. -
getAllowedSize
Returns the size in bytes to be asserted.- Returns:
- The allowed size
-
setCompOper
public 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
public 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
Set the size that shall be asserted.- Parameters:
size
- a number of bytes.
-
setAllowedSize
public void setAllowedSize(long size) Set the size that should be used in the assertion- Parameters:
size
- The number of bytes
-
setTestFieldNetworkSize
public void setTestFieldNetworkSize() -
setTestFieldResponseHeaders
public void setTestFieldResponseHeaders() -
setTestFieldResponseBody
public void setTestFieldResponseBody() -
setTestFieldResponseCode
public void setTestFieldResponseCode() -
setTestFieldResponseMessage
public void setTestFieldResponseMessage() -
getTestField
-
isTestFieldNetworkSize
public boolean isTestFieldNetworkSize() -
isTestFieldResponseHeaders
public boolean isTestFieldResponseHeaders() -
isTestFieldResponseBody
public boolean isTestFieldResponseBody() -
isTestFieldResponseCode
public boolean isTestFieldResponseCode() -
isTestFieldResponseMessage
public boolean isTestFieldResponseMessage()
-