public class IfController extends GenericController implements Serializable, ThreadListener
In a programming world - this is equivalent 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 }
current, subControllersAndSamplers
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
IfController()
constructor
|
IfController(String condition)
constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getCondition()
Condition Accessor - this is gonna be like
${count} < 10 |
boolean |
isDone()
Indicates whether the Controller is done delivering Samplers for the rest
of the test.
|
boolean |
isEvaluateAll() |
boolean |
isUseExpression() |
Sampler |
next()
Determines the next sampler to be processed.
|
void |
setCondition(String condition)
Condition Accessor - this is gonna be like
${count} < 10 |
void |
setEvaluateAll(boolean b) |
void |
setUseExpression(boolean selected) |
void |
threadFinished()
Called for each thread after all samples have been processed.
|
void |
threadStarted()
Called for each thread before starting sampling.
|
void |
triggerEndOfLoop()
Trigger end of loop condition on controller (used by Start Next Loop feature)
|
addIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getSubControllers, incrementCurrent, incrementIterCount, initialize, initializeSubControllers, isFirst, nextIsAController, nextIsASampler, nextIsNull, readResolve, reInitialize, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
public IfController()
public IfController(String condition)
condition
- The condition for this controllerpublic void setCondition(String condition)
${count} < 10
condition
- The condition for this controllerpublic String getCondition()
${count} < 10
public boolean isDone()
Controller
isDone
in interface Controller
isDone
in class GenericController
Controller.isDone()
public Sampler next()
GenericController
Determines the next sampler to be processed.
If GenericController.isDone()
is true
, returns null.
Gets the list element using current pointer.
If this is null
, calls GenericController.nextIsNull()
.
If the list element is a Sampler
, calls GenericController.nextIsASampler(Sampler)
,
otherwise calls GenericController.nextIsAController(Controller)
If any of the called methods throws NextIsNullException
, returns null
,
otherwise the value obtained above is returned.
next
in interface Controller
next
in class GenericController
null
Controller.next()
public void triggerEndOfLoop()
triggerEndOfLoop
in interface Controller
triggerEndOfLoop
in class GenericController
public boolean isEvaluateAll()
public void setEvaluateAll(boolean b)
public boolean isUseExpression()
public void setUseExpression(boolean selected)
public void threadStarted()
ThreadListener
threadStarted
in interface ThreadListener
public void threadFinished()
ThreadListener
threadFinished
in interface ThreadListener
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.