Apache JMeter
2.0.1.20050615

org.apache.jmeter.assertions
Class SizeAssertion

java.lang.Object
  extended byorg.apache.jmeter.testelement.AbstractTestElement
      extended byorg.apache.jmeter.assertions.SizeAssertion
All Implemented Interfaces:
Assertion, Cloneable, Serializable, TestElement

public class SizeAssertion
extends AbstractTestElement
implements Serializable, Assertion

Checks if the results of a Sample matches a particular size.

Version:
$Revision: 1.14 $, $Date: 2004/02/13 01:27:26 $
Author:
Wolfram Rittmeyer
See Also:
Serialized Form

Field Summary
static int EQUAL
           
static int GREATERTHAN
           
static int GREATERTHANEQUAL
           
static int LESSTHAN
           
static int LESSTHANEQUAL
           
static int NOTEQUAL
           
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
SizeAssertion()
           
 
Method Summary
 long getAllowedSize()
          Returns the size in bytes to be asserted.
 int getCompOper()
          Returns the operator to be asserted.
 AssertionResult getResult(SampleResult response)
          Returns the result of the Assertion.
 void setAllowedSize(long size)
          Set the size that shall be asserted.
 void setCompOper(int operator)
          set the Operator
protected  AssertionResult setResultForNull(AssertionResult result)
           
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isRunningVersion, isTemporary, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUAL

public static final int EQUAL
See Also:
Constant Field Values

NOTEQUAL

public static final int NOTEQUAL
See Also:
Constant Field Values

GREATERTHAN

public static final int GREATERTHAN
See Also:
Constant Field Values

LESSTHAN

public static final int LESSTHAN
See Also:
Constant Field Values

GREATERTHANEQUAL

public static final int GREATERTHANEQUAL
See Also:
Constant Field Values

LESSTHANEQUAL

public static final int LESSTHANEQUAL
See Also:
Constant Field Values
Constructor Detail

SizeAssertion

public SizeAssertion()
Method Detail

getResult

public AssertionResult getResult(SampleResult response)
Returns the result of the Assertion. Here it checks wether the Sample took to long to be considered successful. If so an AssertionResult containing a FailureMessage will be returned. Otherwise the returned AssertionResult will reflect the success of the Sample.

Specified by:
getResult in interface Assertion
Parameters:
response - the SampleResult containing information about the Sample (duration, success, etc)
Returns:
the AssertionResult containing the information about whether the assertion passed or failed.

getAllowedSize

public long getAllowedSize()
Returns the size in bytes to be asserted. A duration of 0 indicates this assertion is to be ignored.


setCompOper

public void setCompOper(int operator)
set the Operator


setResultForNull

protected AssertionResult setResultForNull(AssertionResult result)

getCompOper

public int getCompOper()
Returns the operator to be asserted. EQUAL = 1, NOTEQUAL = 2 GREATERTHAN = 3,LESSTHAN = 4,GREATERTHANEQUAL = 5,LESSTHANEQUAL = 6


setAllowedSize

public void setAllowedSize(long size)
                    throws IllegalArgumentException
Set the size that shall be asserted.

Parameters:
size - - a number of bytes. Is not allowed to be negative. Use Long.MAX_VALUE to indicate illegal or empty inputs. This will result in not checking the assertion.
Throws:
IllegalArgumentException - If size is negative.

Apache JMeter
2.0.1.20050615

Copyright © 1998-2005 Apache Software Foundation. All Rights Reserved.