TestAction (Apache JMeter dist API)
Description: declaration: package: org.apache.jmeter.sampler, class: TestAction

Package org.apache.jmeter.sampler

# Class TestAction

java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.sampler.TestAction

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `ConfigMergabilityIndicator`, `Searchable`, `Interruptible`, `Sampler`, `org.apache.jmeter.testelement.TestElement`

public class TestAction extends AbstractSampler implements Interruptible
Dummy Sampler used to pause or stop a thread or the test; intended for use in Conditional Controllers.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement

  `org.apache.jmeter.testelement.TestElement.Companion`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `BREAK_CURRENT_LOOP`
  Break Current Loop
  `static final int`
  `PAUSE`
  `static final int`
  `RESTART_NEXT_LOOP`
  Start next iteration of Thread Loop
  `static final int`
  `START_NEXT_ITERATION_CURRENT_LOOP`
  Start next iteration of Current Loop
  `static final int`
  `STOP`
  `static final int`
  `STOP_NOW`
  `static final int`
  `TEST`
  `static final int`
  `THREAD`

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

  `COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TestAction()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applies(ConfigTestElement configElement)`
  Does configElement apply to Sampler
  `int`
  `getAction()`
  `String`
  `getDurationAsString()`
  `int`
  `getTarget()`
  `boolean`
  `interrupt()`
  Interrupt the current operation if possible.
  `SampleResult`
  `sample(Entry e)`
  Obtains statistics about the given Entry, and packages the information into a SampleResult.
  `void`
  `setAction(int action)`
  `void`
  `setDuration(String duration)`
  `void`
  `setTarget(int target)`

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

  `addPropertiesValues, addProperty, addProperty, addTestElement, 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, traverseProperty`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface 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, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getProps, getSchema, 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`

- ## Field Details

  - ### STOP

    public static final int STOP
    See Also:
      - Constant Field Values

  - ### PAUSE

    public static final int PAUSE
    See Also:
      - Constant Field Values

  - ### STOP_NOW

    public static final int STOP_NOW
    See Also:
      - Constant Field Values

  - ### RESTART_NEXT_LOOP

    public static final int RESTART_NEXT_LOOP
    Start next iteration of Thread Loop
    See Also:
      - Constant Field Values

  - ### START_NEXT_ITERATION_CURRENT_LOOP

    public static final int START_NEXT_ITERATION_CURRENT_LOOP
    Start next iteration of Current Loop
    See Also:
      - Constant Field Values

  - ### BREAK_CURRENT_LOOP

    public static final int BREAK_CURRENT_LOOP
    Break Current Loop
    See Also:
      - Constant Field Values

  - ### THREAD

    public static final int THREAD
    See Also:
      - Constant Field Values

  - ### TEST

    public static final int TEST
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### TestAction

    public TestAction()

- ## Method Details

  - ### sample

    public SampleResult sample(Entry e)
    Obtains statistics about the given Entry, and packages the information into a SampleResult.
    Specified by:
      `sample` in interface `Sampler`
    Parameters:
      `e` - the Entry (TODO seems to be unused)
    Returns:
      information about the sample

  - ### setTarget

    public void setTarget(int target)

  - ### getTarget

    public int getTarget()

  - ### setAction

    public void setAction(int action)

  - ### getAction

    public int getAction()

  - ### setDuration

    public void setDuration(String duration)

  - ### getDurationAsString

    public String getDurationAsString()

  - ### applies

    public boolean applies(ConfigTestElement configElement)
    Description copied from class: `AbstractSampler`
    Does configElement apply to Sampler
    Specified by:
      `applies` in interface `ConfigMergabilityIndicator`
    Overrides:
      `applies` in class `AbstractSampler`
    Parameters:
      `configElement` - `ConfigTestElement`
    Returns:
      boolean
    See Also:
      - `AbstractSampler.applies(org.apache.jmeter.config.ConfigTestElement)`

  - ### interrupt

    public boolean interrupt()
    Description copied from interface: `Interruptible`
    Interrupt the current operation if possible.
    Specified by:
      `interrupt` in interface `Interruptible`
    Returns:
      `true` if there was an operation to interrupt.