Class StandardJMeterEngine

java.lang.Object
org.apache.jmeter.engine.StandardJMeterEngine
All Implemented Interfaces:
Runnable, JMeterEngine

public class StandardJMeterEngine extends Object implements JMeterEngine, Runnable
Runs JMeter tests, either directly for local GUI and non-GUI invocations, or started by RemoteJMeterEngineImpl when running in server mode.
  • Constructor Details

    • StandardJMeterEngine

      public StandardJMeterEngine()
    • StandardJMeterEngine

      public StandardJMeterEngine(String host)
  • Method Details

    • stopEngineNow

      public static void stopEngineNow()
    • stopEngine

      public static void stopEngine()
    • register

      public static void register(TestStateListener tl)
    • stopThread

      public static boolean stopThread(String threadName)
    • stopThreadNow

      public static boolean stopThreadNow(String threadName)
    • configure

      public void configure(HashTree testTree)
      Description copied from interface: JMeterEngine
      Configure engine
      Specified by:
      configure in interface JMeterEngine
      Parameters:
      testTree - the test plan
    • runTest

      public void runTest() throws JMeterEngineException
      Description copied from interface: JMeterEngine
      Runs the test
      Specified by:
      runTest in interface JMeterEngine
      Throws:
      JMeterEngineException - if an error occurs
    • awaitTermination

      @API(status=EXPERIMENTAL, since="5.6") public void awaitTermination(Duration duration) throws ExecutionException, InterruptedException, TimeoutException
      Throws:
      ExecutionException
      InterruptedException
      TimeoutException
    • reset

      public void reset()
      Description copied from interface: JMeterEngine
      Stop test if running
      Specified by:
      reset in interface JMeterEngine
    • stopTest

      public void stopTest()
      Stop Test Now
      Specified by:
      stopTest in interface JMeterEngine
    • stopTest

      public void stopTest(boolean now)
      Specified by:
      stopTest in interface JMeterEngine
      Parameters:
      now - boolean that tell whether stop is immediate (interrupt) or not (wait for current sample end)
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • askThreadsToStop

      public void askThreadsToStop()
      Clean shutdown ie, wait for end of current running samplers
    • exit

      public void exit()
      Remote exit Called by RemoteJMeterEngineImpl.rexit() and by notifyTestListenersOfEnd() iff exitAfterTest is true; in turn that is called by the run() method and the StopTest class also called
      Specified by:
      exit in interface JMeterEngine
    • setProperties

      public void setProperties(Properties p)
      Description copied from interface: JMeterEngine
      set Properties on engine
      Specified by:
      setProperties in interface JMeterEngine
      Parameters:
      p - the properties to set
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface JMeterEngine
      Returns:
      boolean Flag to show whether engine is active (true when test is running). Set to false at end of test