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 int
EQUAL
public final static int
NOTEQUAL
public final static int
GREATERTHAN
public final static int
LESSTHAN
public final static int
GREATERTHANEQUAL
public final static int
LESSTHANEQUAL
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description SizeAssertion()
-
Method Summary
Modifier and Type Method Description AssertionResult
getResult(SampleResult response)
Returns the result of the Assertion. String
getAllowedSize()
Returns the size in bytes to be asserted. void
setCompOper(int operator)
Set the operator used for the assertion. int
getCompOper()
Returns the operator to be asserted. void
setAllowedSize(String size)
Set the size that shall be asserted. void
setAllowedSize(long size)
Set the size that should be used in the assertion void
setTestFieldNetworkSize()
void
setTestFieldResponseHeaders()
void
setTestFieldResponseBody()
void
setTestFieldResponseCode()
void
setTestFieldResponseMessage()
String
getTestField()
boolean
isTestFieldNetworkSize()
boolean
isTestFieldResponseHeaders()
boolean
isTestFieldResponseBody()
boolean
isTestFieldResponseCode()
boolean
isTestFieldResponseMessage()
-
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.
-
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
-
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()
-
-
-
-