Interface IJMeterSession


public interface IJMeterSession
Interface for creation, management, deletion of JMeter sessions
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method gets called before start of a session providing necessary properties to the JMeter session
    void
    applyProperties(InputStream propStream, Map<String,Object> properties)
    This method gets called before start of a session providing necessary properties to the JMeter session The properties hashmap adds upon the propStream input with personalised properties
    Returns the consoleOutput in String format
    long
    Returns the exit code of the the shutdown of the JMeterProcess
    Returning the jmxFile in UTF-8 encoding in String format The working directory is found through the session instance
    Return the output file of your jmx execution in String format The working directory is found through the session instance
    Returning the logFile in UTF-8 encoding in String format The working directory is found through the session instance
    int
     
    void
    Allows the tester to provide a jmxFile to the running session This method is provided to run dynamic JMX-files that are dynamic with the current session it is running in JMX-files have to be prepared for this by replacing ALL the $P__VARIABLE notations with $VARIABLE notations Then by adding neccesary parameters inside a HashMap with it, it is possible to change the target of a test dynamically inside the test Example: HashMapinvalid input: '<'String,Object> map = new HashMapinvalid input: '<'String,Object>(); map.put("HOST", "galasa.dev"); session.setChangedParametersJmxFile(jmxStream, map);
    void
    Allows the tester to provide a jmxFile to the running session This method is provided to run static JMX-files that are NOT dynamic with the current session it is running in
    void
    Start up a jmeter thread to run through the lifetime of the tests with a default timeout of 60 seconds All results are stored in the RAS
    void
    startJmeter(int timeout)
    Start up a jmeter thread to run through the lifetime of the tests with a specified timeout All results are stored in the RAS
    boolean
     
    void
    Giving jmeter instance a shutdown signal to finish and clean up all running tests
  • Method Details

    • applyProperties

      void applyProperties(InputStream propStream) throws JMeterManagerException
      This method gets called before start of a session providing necessary properties to the JMeter session
      Parameters:
      propStream - An inputstream of the properties file
      Throws:
      JMeterManagerException
    • applyProperties

      void applyProperties(InputStream propStream, Map<String,Object> properties) throws JMeterManagerException
      This method gets called before start of a session providing necessary properties to the JMeter session The properties hashmap adds upon the propStream input with personalised properties
      Parameters:
      propStream - An inputstream of the properties file
      properties - A hashmap of dynamic properties
      Throws:
      JMeterManagerException
    • startJmeter

      void startJmeter() throws JMeterManagerException
      Start up a jmeter thread to run through the lifetime of the tests with a default timeout of 60 seconds All results are stored in the RAS
      Throws:
      JMeterManagerException
    • startJmeter

      void startJmeter(int timeout) throws JMeterManagerException
      Start up a jmeter thread to run through the lifetime of the tests with a specified timeout All results are stored in the RAS
      Throws:
      JMeterManagerException
    • setDefaultGeneratedJmxFile

      void setDefaultGeneratedJmxFile(InputStream jmxStream) throws JMeterManagerException
      Allows the tester to provide a jmxFile to the running session This method is provided to run static JMX-files that are NOT dynamic with the current session it is running in
      Parameters:
      jmxStream -
      Throws:
      JMeterManagerException
    • setChangedParametersJmxFile

      void setChangedParametersJmxFile(InputStream jmxStream, Map<String,Object> parameters) throws JMeterManagerException
      Allows the tester to provide a jmxFile to the running session This method is provided to run dynamic JMX-files that are dynamic with the current session it is running in JMX-files have to be prepared for this by replacing ALL the $P__VARIABLE notations with $VARIABLE notations Then by adding neccesary parameters inside a HashMap with it, it is possible to change the target of a test dynamically inside the test Example: HashMapinvalid input: '<'String,Object> map = new HashMapinvalid input: '<'String,Object>(); map.put("HOST", "galasa.dev"); session.setChangedParametersJmxFile(jmxStream, map);
      Parameters:
      jmxStream -
      parameters -
      Throws:
      JMeterManagerException
    • getJmxFile

      String getJmxFile() throws JMeterManagerException
      Returning the jmxFile in UTF-8 encoding in String format The working directory is found through the session instance
      Throws:
      JMeterManagerException
    • getLogFile

      String getLogFile() throws JMeterManagerException
      Returning the logFile in UTF-8 encoding in String format The working directory is found through the session instance
      Throws:
      JMeterManagerException
    • getConsoleOutput

      String getConsoleOutput() throws JMeterManagerException
      Returns the consoleOutput in String format
      Returns:
      String of console
      Throws:
      JMeterManagerException
    • getListenerFile

      String getListenerFile(String fileName) throws JMeterManagerException
      Return the output file of your jmx execution in String format The working directory is found through the session instance
      Parameters:
      fileName - the ListenerFile
      Throws:
      JMeterManagerException
    • statusTest

      boolean statusTest() throws JMeterManagerException
      Returns:
      the logFile gets returned as a string like "cat" would in a linux container
      Throws:
      JMeterManagerException
    • stopTest

      void stopTest() throws JMeterManagerException
      Giving jmeter instance a shutdown signal to finish and clean up all running tests
      Parameters:
      timeout - specifying a timeout in milliseconds
      Throws:
      JMeterManagerException
    • getExitCode

      long getExitCode() throws JMeterManagerException
      Returns the exit code of the the shutdown of the JMeterProcess
      Returns:
      exitcode as a long
      Throws:
      JMeterManagerException
    • getSessionID

      int getSessionID()