Class SaveService

java.lang.Object
org.apache.jmeter.save.SaveService

public class SaveService extends Object
Handles setting up XStream serialisation. The class reads alias definitions from saveservice.properties.
  • Field Details

  • Constructor Details

    • SaveService

      public SaveService()
  • Method Details

    • loadProperties

      public static Properties loadProperties() throws IOException
      Throws:
      IOException
    • aliasToClass

      public static String aliasToClass(String s)
    • classToAlias

      public static String classToAlias(String s)
    • saveTree

      public static void saveTree(HashTree tree, OutputStream out) throws IOException
      Throws:
      IOException
    • saveElement

      public static void saveElement(Object el, OutputStream out) throws IOException
      Throws:
      IOException
    • loadElement

      public static Object loadElement(InputStream in) throws IOException
      Throws:
      IOException
    • saveSampleResult

      public static void saveSampleResult(SampleEvent evt, Writer writer) throws IOException
      Save a sampleResult to an XML output file using XStream.
      Parameters:
      evt - sampleResult wrapped in a sampleEvent
      writer - output stream which must be created using getFileEncoding(String)
      Throws:
      IOException - when writing data to output fails
    • loadTestResults

      public static void loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper) throws IOException
      Read results from JTL file.
      Parameters:
      reader - of the file
      resultCollectorHelper - helper class to enable TestResultWrapperConverter to deliver the samples
      Throws:
      IOException - if an I/O error occurs
    • loadTree

      public static HashTree loadTree(File file) throws IOException
      Load a Test tree (JMX file)
      Parameters:
      file - the JMX file
      Returns:
      the loaded tree
      Throws:
      IOException - if there is a problem reading the file or processing it
    • getFileEncoding

      public static String getFileEncoding(String dflt)
      Returns the file Encoding specified in saveservice.properties or the default
      Parameters:
      dflt - value to return if file encoding was not provided
      Returns:
      file encoding or default
    • CEtoString

      public static String CEtoString(com.thoughtworks.xstream.converters.ConversionException ce)
      Simplify getMessage() output from XStream ConversionException
      Parameters:
      ce - - ConversionException to analyse
      Returns:
      string with details of error
    • getPropertiesVersion

      public static String getPropertiesVersion()
    • getVERSION

      public static String getVERSION()