org.apache.jmeter.control

Class IfController

Implemented Interfaces:
Cloneable, Serializable, Controller, TestElement

public class IfController
extends GenericController
implements Serializable

This is a Conditional Controller; it will execute the set of statements (samplers/controllers, etc) while the 'condition' is true. In a programming world - this is equivalant of : if (condition) { statements .... } In JMeter you may have : Thread-Group (set to loop a number of times or indefinitely, ... Samplers ... (e.g. Counter ) ... Other Controllers .... ... IfController ( condition set to something like - ${counter}<10) ... statements to perform if condition is true ... ... Other Controllers /Samplers }

Field Summary

Fields inherited from class org.apache.jmeter.control.GenericController

current, subControllersAndSamplers

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

IfController()
constructor
IfController(String condition)
constructor

Method Summary

String
getCondition()
Condition Accessor - this is gonna be like ${count}<10
boolean
isDone()
This is overriding the parent method.
boolean
isEvaluateAll()
boolean
isUseExpression()
Sampler
next()
void
setCondition(String condition)
Condition Accessor - this is gonna be like ${count}<10
void
setEvaluateAll(boolean b)
void
setUseExpression(boolean selected)

Methods inherited from class org.apache.jmeter.control.GenericController

addIterationListener, addTestElement, currentReturnedNull, fireIterEvents, fireIterationStart, getCurrentElement, getIterCount, getSubControllers, incrementCurrent, incrementIterCount, initialize, isDone, isFirst, next, nextIsAController, nextIsASampler, nextIsNull, reInitialize, removeCurrentElement, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty

Constructor Details

IfController

public IfController()
constructor

IfController

public IfController(String condition)
constructor

Method Details

getCondition

public String getCondition()
Condition Accessor - this is gonna be like ${count}<10

isDone

public boolean isDone()
This is overriding the parent method. IsDone indicates whether the termination condition is reached. I.e. if the condition evaluates to False - then isDone() returns TRUE
Specified by:
isDone in interface Controller
Overrides:
isDone in interface GenericController

isEvaluateAll

public boolean isEvaluateAll()

isUseExpression

public boolean isUseExpression()

next

public Sampler next()
Specified by:
next in interface Controller
Overrides:
next in interface GenericController

setCondition

public void setCondition(String condition)
Condition Accessor - this is gonna be like ${count}<10

setEvaluateAll

public void setEvaluateAll(boolean b)

setUseExpression

public void setUseExpression(boolean selected)

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