Class LoopController
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.jmeter.control.Controller
,org.apache.jmeter.control.IteratingController
,org.apache.jmeter.engine.event.LoopIterationListener
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.testelement.TestElement
,org.apache.jmeter.threads.TestCompilerHelper
public class LoopController extends GenericController implements Serializable, IteratingController, LoopIterationListener
Class that implements the Loop Controller, ie iterate infinitely or a configured number of times
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
INFINITE_LOOP_COUNT
public final static String
LOOPS
private transient boolean
runningVersion
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 LoopController()
-
Method Summary
Modifier and Type Method Description LoopControllerSchema
getSchema()
PropertiesAccessor<out LoopController, out LoopControllerSchema>
getProps()
Allows type-safe accessors to the properties of the current element. void
setLoops(int loops)
void
setLoops(String loopValue)
int
getLoops()
String
getLoopString()
void
setContinueForever(boolean forever)
Determines whether the loop will return any samples if it is rerun. Sampler
next()
Determines the next sampler to be processed. void
triggerEndOfLoop()
void
startNextLoop()
Start next iteration void
breakLoop()
Break loop ("break" keyword equivalent) void
iterationStart(LoopIterationEvent iterEvent)
Called when a loop iteration is about to start. -
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Methods inherited from class org.apache.jmeter.control.GenericController
addIterationListener, addTestElement, addTestElementOnce, initialize, isDone, removeIterationListener, setFirst
-
Methods inherited from class org.apache.jmeter.control.IteratingController
updateIterationIndex
-
Methods inherited from class org.apache.jmeter.control.Controller
addIterationListener
-
Methods inherited from class org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getProps, getSchema, getString, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, removed, set, setComment, setEnabled, setName, setProperty, setTemporary, traverse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSchema
LoopControllerSchema getSchema()
-
getProps
PropertiesAccessor<out LoopController, out LoopControllerSchema> getProps()
Allows type-safe accessors to the properties of the current element. Note: when overriding the method, ensure you emit wildcards. For instance: JMeterElementInstance<? extends TestPlanClass> getProps() { return ... }
-
setLoops
void setLoops(int loops)
-
getLoops
int getLoops()
-
getLoopString
String getLoopString()
-
setContinueForever
void setContinueForever(boolean forever)
Determines whether the loop will return any samples if it is rerun.
- Parameters:
forever
- true if the loop must be reset after ending a run
-
next
Sampler next()
Determines the next sampler to be processed.
If #isDone() is
true
, returns null.Gets the list element using current pointer. If this is
null
, calls #nextIsNull().If the list element is a , calls #nextIsASampler(Sampler), otherwise calls #nextIsAController(Controller)
If any of the called methods throws , returns
null
, otherwise the value obtained above is returned.
-
triggerEndOfLoop
void triggerEndOfLoop()
-
startNextLoop
void startNextLoop()
Start next iteration
-
breakLoop
void breakLoop()
Break loop ("break" keyword equivalent)
-
iterationStart
void iterationStart(LoopIterationEvent iterEvent)
Called when a loop iteration is about to start.
- Parameters:
iterEvent
- the event
-
-
-
-