org.apache.jmeter.threads

## Class SamplePackage

- java.lang.Object
- - org.apache.jmeter.threads.SamplePackage

-     public class SamplePackage
      extends java.lang.Object

  Packages methods related to sample handling.
  A SamplePackage contains all elements associated to a Sampler:
  - SampleListener(s)
  - Timer(s)
  - Assertion(s)
  - PreProcessor(s)
  - PostProcessor(s)
  - ConfigTestElement(s)
  - Controller(s)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SamplePackage(java.util.List<ConfigTestElement> configs, java.util.List<SampleListener> listeners, java.util.List<Timer> timers, java.util.List<Assertion> assertions, java.util.List<PostProcessor> postProcessors, java.util.List<PreProcessor> preProcessors, java.util.List<Controller> controllers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAssertion(Assertion asser)` Add Assertion
    `void` | `addPostProcessor(PostProcessor ex)` Add Post processor
    `void` | `addPreProcessor(PreProcessor pre)` Add Pre processor
    `void` | `addSampleListener(SampleListener listener)` Add Sample Listener
    `void` | `addTimer(Timer timer)` Add Timer
    `java.util.List<Assertion>` | `getAssertions()`
    `java.util.List<ConfigTestElement>` | `getConfigs()` Returns the configs.
    `java.util.List<PostProcessor>` | `getPostProcessors()`
    `java.util.List<PreProcessor>` | `getPreProcessors()` Returns the preProcessors.
    `java.util.List<SampleListener>` | `getSampleListeners()`
    `Sampler` | `getSampler()`
    `java.util.List<Timer>` | `getTimers()`
    `void` | `recoverRunningVersion()` Recover each member of SamplePackage to the state before the call of setRunningVersion(true)
    `void` | `setRunningVersion(boolean running)` Make the SamplePackage the running version, or make it no longer the running version.
    `void` | `setSampler(Sampler s)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SamplePackage

          public SamplePackage(java.util.List<ConfigTestElement> configs,
                               java.util.List<SampleListener> listeners,
                               java.util.List<Timer> timers,
                               java.util.List<Assertion> assertions,
                               java.util.List<PostProcessor> postProcessors,
                               java.util.List<PreProcessor> preProcessors,
                               java.util.List<Controller> controllers)

  - ### Method Detail

    - #### setRunningVersion

          public void setRunningVersion(boolean running)

      Make the SamplePackage the running version, or make it no longer the running version. This tells to each element of the SamplePackage that it's current state must be retrievable by a call to recoverRunningVersion().
      Parameters:
        `running` - boolean
      See Also:
        `TestElement.setRunningVersion(boolean)`

    - #### recoverRunningVersion

          public void recoverRunningVersion()

      Recover each member of SamplePackage to the state before the call of setRunningVersion(true)
      See Also:
        `TestElement.recoverRunningVersion()`

    - #### getSampleListeners

          public java.util.List<SampleListener> getSampleListeners()

      Returns:
        List of `SampleListener`s

    - #### addSampleListener

          public void addSampleListener(SampleListener listener)

      Add Sample Listener
      Parameters:
        `listener` - `SampleListener`

    - #### getTimers

          public java.util.List<Timer> getTimers()

      Returns:
        List of `Timer`s

    - #### addPostProcessor

          public void addPostProcessor(PostProcessor ex)

      Add Post processor
      Parameters:
        `ex` - `PostProcessor`

    - #### addPreProcessor

          public void addPreProcessor(PreProcessor pre)

      Add Pre processor
      Parameters:
        `pre` - `PreProcessor`

    - #### addTimer

          public void addTimer(Timer timer)

      Add Timer
      Parameters:
        `timer` - `Timer`

    - #### addAssertion

          public void addAssertion(Assertion asser)

      Add Assertion
      Parameters:
        `asser` - `Assertion`

    - #### getAssertions

          public java.util.List<Assertion> getAssertions()

      Returns:
        List of `Assertion`

    - #### getPostProcessors

          public java.util.List<PostProcessor> getPostProcessors()

      Returns:
        List of `PostProcessor`s

    - #### getSampler

          public Sampler getSampler()

      Returns:
        `Sampler`

    - #### setSampler

          public void setSampler(Sampler s)

      Parameters:
        `s` - `Sampler`

    - #### getPreProcessors

          public java.util.List<PreProcessor> getPreProcessors()

      Returns the preProcessors.
      Returns:
        List of `PreProcessor`

    - #### getConfigs

          public java.util.List<ConfigTestElement> getConfigs()

      Returns the configs.
      Returns:
        List of `ConfigTestElement`

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