Class SwitchController
- All Implemented Interfaces:
- Serializable,- Cloneable,- Controller,- Searchable,- org.apache.jmeter.testelement.TestElement,- TestCompilerHelper
Implements a controller which selects at most one of its children based on the condition value, which may be a number or a string.
For numeric input, the controller processes the appropriate child, where the numbering starts from 0. If the number is out of range, then the first (0th) child is selected. If the condition is the empty string, then it is assumed to be 0.
For non-empty non-numeric input, the child is selected by name. This may be the name of the controller or a sampler. If the string does not match any of the names, then the controller with the name "default" (any case) is processed. If there is no default entry, then unlike the numeric case, no child is selected.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from class org.apache.jmeter.control.GenericControllercurrent, subControllersAndSamplersFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidincrementCurrent is called when the current child (whether sampler or controller) has been processed.next()Determines the next sampler to be processed.voidsetSelection(String inputValue) Methods inherited from class org.apache.jmeter.control.GenericControlleraddIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getProps, getSchema, getSubControllers, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, nextIsAController, nextIsASampler, nextIsNull, readResolve, reInitialize, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoopMethods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, 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, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementcanRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
- 
Constructor Details- 
SwitchControllerpublic SwitchController()
 
- 
- 
Method Details- 
nextDescription copied from class:GenericControllerDetermines the next sampler to be processed. If GenericController.isDone()istrue, returns null.Gets the list element using current pointer. If this is null, callsGenericController.nextIsNull().If the list element is a Sampler, callsGenericController.nextIsASampler(Sampler), otherwise callsGenericController.nextIsAController(Controller)If any of the called methods throws NextIsNullException, returnsnull, otherwise the value obtained above is returned.- Specified by:
- nextin interface- Controller
- Overrides:
- nextin class- GenericController
- Returns:
- the next sampler or null
 
- 
incrementCurrentprotected void incrementCurrent()incrementCurrent is called when the current child (whether sampler or controller) has been processed.Setting it to int.max marks the controller as having processed all its children. Thus the controller processes one child per iteration. Increments the current pointer; called by currentReturnedNull to move the controller on to its next child. - Overrides:
- incrementCurrentin class- GenericController
 
- 
setSelection
- 
getSelection
 
-