Class AbstractThreadGroup

    • Field Detail

      • ON_SAMPLE_ERROR

        public static final String ON_SAMPLE_ERROR
        Action to be taken when a Sampler error occurs
        See Also:
        Constant Field Values
      • ON_SAMPLE_ERROR_CONTINUE

        public static final String ON_SAMPLE_ERROR_CONTINUE
        Continue, i.e. ignore sampler errors
        See Also:
        Constant Field Values
      • ON_SAMPLE_ERROR_START_NEXT_LOOP

        public static final String ON_SAMPLE_ERROR_START_NEXT_LOOP
        Start next loop for current thread if sampler error occurs
        See Also:
        Constant Field Values
      • ON_SAMPLE_ERROR_STOPTHREAD

        public static final String ON_SAMPLE_ERROR_STOPTHREAD
        Stop current thread if sampler error occurs
        See Also:
        Constant Field Values
      • ON_SAMPLE_ERROR_STOPTEST

        public static final String ON_SAMPLE_ERROR_STOPTEST
        Stop test (all threads) if sampler error occurs, the entire test is stopped at the end of any current samples
        See Also:
        Constant Field Values
      • ON_SAMPLE_ERROR_STOPTEST_NOW

        public static final String ON_SAMPLE_ERROR_STOPTEST_NOW
        Stop test NOW (all threads) if sampler error occurs, the entire test is stopped abruptly. Any current samplers are interrupted if possible.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractThreadGroup

        public AbstractThreadGroup()
    • Method Detail

      • isDone

        public boolean isDone()
        Indicates whether the Controller is done delivering Samplers for the rest of the test. When the top-level controller returns true to JMeterThread, the thread is complete.
        Specified by:
        isDone in interface Controller
        Returns:
        boolean
      • next

        public Sampler next()
        Delivers the next Sampler or null
        Specified by:
        next in interface Controller
        Returns:
        org.apache.jmeter.samplers.Sampler or null
      • getSamplerController

        public Controller getSamplerController()
        Get the sampler controller.
        Returns:
        the sampler controller.
      • setSamplerController

        public void setSamplerController​(LoopController c)
        Set the sampler controller.
        Parameters:
        c - the sampler controller.
      • addTestElementOnce

        public final boolean addTestElementOnce​(TestElement child)
        Add child test element only if it has not already been added.

        Only for use by TestCompiler.

        Specified by:
        addTestElementOnce in interface TestCompilerHelper
        Parameters:
        child - the TestElement to be added
        Returns:
        true if the child was added
      • initialize

        public void initialize()
        Called to initialize a controller at the beginning of a test iteration.
        Specified by:
        initialize in interface Controller
      • startNextLoop

        public void startNextLoop()
        Start next iteration after an error
      • setNumThreads

        public void setNumThreads​(int numThreads)
        Set the total number of threads to start
        Parameters:
        numThreads - the number of threads.
      • getNumberOfThreads

        public int getNumberOfThreads()
        Get the number of active threads
        Returns:
        the number of active threads
      • getNumThreads

        public int getNumThreads()
        Get the number of threads.
        Returns:
        the number of threads.
      • getOnErrorStartNextLoop

        public boolean getOnErrorStartNextLoop()
        Check if a sampler error should cause thread to start next loop.
        Returns:
        true if thread should start next loop
      • getOnErrorStopThread

        public boolean getOnErrorStopThread()
        Check if a sampler error should cause thread to stop.
        Returns:
        true if thread should stop
      • getOnErrorStopTest

        public boolean getOnErrorStopTest()
        Check if a sampler error should cause test to stop.
        Returns:
        true if test (all threads) should stop
      • getOnErrorStopTestNow

        public boolean getOnErrorStopTestNow()
        Check if a sampler error should cause test to stop now.
        Returns:
        true if test (all threads) should stop immediately
      • stopThread

        public abstract boolean stopThread​(String threadName,
                                           boolean now)
      • numberOfActiveThreads

        public abstract int numberOfActiveThreads()
      • verifyThreadsStopped

        public abstract boolean verifyThreadsStopped()
      • waitThreadsStopped

        public abstract void waitThreadsStopped()
      • tellThreadsToStop

        public abstract void tellThreadsToStop()
      • stop

        public abstract void stop()