org.apache.jmeter.control

Class InterleaveControl

Implemented Interfaces:
Cloneable, Serializable, Controller, TestElement
Known Direct Subclasses:
RandomController

public class InterleaveControl
extends GenericController
implements Serializable

Field Summary

static int
IGNORE_SUB_CONTROLLERS
static int
USE_SUB_CONTROLLERS

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

InterleaveControl()
Constructor for the InterleaveControl object

Method Summary

protected void
currentReturnedNull(Controller c)
If the controller is done, remove it from the list, otherwise increment to next entry in list.
int
getStyle()
protected void
incrementCurrent()
Increments the current pointer; called by currentReturnedNull to move the controller on to its next child.
protected boolean
isSkipNext()
Sampler
next()
Determines the next sampler to be processed.
protected Sampler
nextIsAController(Controller controller)
Called by next() if the element is a Controller, and returns the next sampler from the controller.
protected Sampler
nextIsASampler(Sampler element)
Increment the current pointer and return the element.
protected Sampler
nextIsNull()
If the current is null, reset and continue searching.
void
reInitialize()
Resets the controller:
  • resetCurrent() (i.e. current=0)
  • increment iteration count
  • sets first=true
  • recoverRunningVersion() to set the controller back to the initial state
protected void
setCurrentElement(TestElement currentElement)
Empty implementation - does nothing.
protected void
setSkipNext(boolean skipNext)
void
setStyle(int style)

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

Field Details

IGNORE_SUB_CONTROLLERS

public static final int IGNORE_SUB_CONTROLLERS
Field Value:
0

USE_SUB_CONTROLLERS

public static final int USE_SUB_CONTROLLERS
Field Value:
1

Constructor Details

InterleaveControl

public InterleaveControl()
Constructor for the InterleaveControl object

Method Details

currentReturnedNull

protected void currentReturnedNull(Controller c)
If the controller is done, remove it from the list, otherwise increment to next entry in list.
Overrides:
currentReturnedNull in interface GenericController
Parameters:
c - controller

getStyle

public int getStyle()

incrementCurrent

protected void incrementCurrent()
Increments the current pointer; called by currentReturnedNull to move the controller on to its next child.
Overrides:
incrementCurrent in interface GenericController

isSkipNext

protected boolean isSkipNext()
Returns:
skipNext

next

public Sampler next()
Determines the next sampler to be processed.

If isDone, 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.

Specified by:
next in interface Controller
Overrides:
next in interface GenericController
Returns:
the next sampler or null

nextIsAController

protected Sampler nextIsAController(Controller controller)
            throws NextIsNullException
Called by next() if the element is a Controller, and returns the next sampler from the controller. If this is null, then updates the current pointer and makes recursive call to next().
Overrides:
nextIsAController in interface GenericController
Parameters:
controller -
Returns:
the next sampler

nextIsASampler

protected Sampler nextIsASampler(Sampler element)
            throws NextIsNullException
Increment the current pointer and return the element. Called by next() if the element is a sampler. (May be overriden by sub-classes).
Overrides:
nextIsASampler in interface GenericController
Parameters:
element -
Returns:
input element

nextIsNull

protected Sampler nextIsNull()
If the current is null, reset and continue searching. The searchStart attribute will break us off when we start a repeat.
Overrides:
nextIsNull in interface GenericController

reInitialize

public void reInitialize()
Resets the controller:
  • resetCurrent() (i.e. current=0)
  • increment iteration count
  • sets first=true
  • recoverRunningVersion() to set the controller back to the initial state
Overrides:
reInitialize in interface GenericController

setCurrentElement

protected void setCurrentElement(TestElement currentElement)
            throws NextIsNullException
Empty implementation - does nothing.
Overrides:
setCurrentElement in interface GenericController
Parameters:
currentElement -

setSkipNext

protected void setSkipNext(boolean skipNext)
Parameters:
skipNext -

setStyle

public void setStyle(int style)

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