Apache JMeter

org.apache.jmeter.save
Class SaveService

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

public class SaveService
extends java.lang.Object

Handles setting up XStream serialisation. The class reads alias definitions from saveservice.properties.


Field Summary
static java.lang.String RESULTCOLLECTOR_HELPER_OBJECT
           
static java.lang.String SAMPLE_EVENT_OBJECT
           
static java.lang.String TESTLOG_FORMAT
           
static java.lang.String TESTPLAN_FORMAT
           
 
Constructor Summary
SaveService()
           
 
Method Summary
static java.lang.String aliasToClass(java.lang.String s)
           
static java.lang.String CEtoString(ConversionException ce)
          Simplify getMessage() output from XStream ConversionException
static java.lang.String classToAlias(java.lang.String s)
           
static java.lang.String getFileEncoding(java.lang.String dflt)
          Returns the file Encoding specified in saveservice.properties or the default
static java.lang.String getPropertiesVersion()
           
static java.lang.String getVERSION()
           
static boolean isSaveTestLogFormat20()
           
static boolean isSaveTestPlanFormat20()
           
static boolean isSaveTestPlanFormat22()
           
static java.lang.Object loadElement(java.io.InputStream in)
           
static java.util.Properties loadProperties()
           
static void loadTestResults(java.io.InputStream reader, ResultCollectorHelper resultCollectorHelper)
          Read results from JTL file.
static HashTree loadTree(java.io.InputStream reader)
          Load a Test tree (JMX file)
static void saveElement(java.lang.Object el, java.io.OutputStream out)
           
static void saveSampleResult(SampleEvent evt, java.io.Writer writer)
          Save a sampleResult to an XML output file using XStream.
static void saveTestElement(TestElement elem, java.io.Writer writer)
           
static void saveTree(HashTree tree, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAMPLE_EVENT_OBJECT

public static final java.lang.String SAMPLE_EVENT_OBJECT
See Also:
Constant Field Values

RESULTCOLLECTOR_HELPER_OBJECT

public static final java.lang.String RESULTCOLLECTOR_HELPER_OBJECT
See Also:
Constant Field Values

TESTPLAN_FORMAT

public static final java.lang.String TESTPLAN_FORMAT

TESTLOG_FORMAT

public static final java.lang.String TESTLOG_FORMAT
Constructor Detail

SaveService

public SaveService()
Method Detail

loadProperties

public static java.util.Properties loadProperties()
                                           throws java.io.IOException
Throws:
java.io.IOException

aliasToClass

public static java.lang.String aliasToClass(java.lang.String s)

classToAlias

public static java.lang.String classToAlias(java.lang.String s)

saveTree

public static void saveTree(HashTree tree,
                            java.io.OutputStream out)
                     throws java.io.IOException
Throws:
java.io.IOException

saveElement

public static void saveElement(java.lang.Object el,
                               java.io.OutputStream out)
                        throws java.io.IOException
Throws:
java.io.IOException

loadElement

public static java.lang.Object loadElement(java.io.InputStream in)
                                    throws java.io.IOException
Throws:
java.io.IOException

saveSampleResult

public static void saveSampleResult(SampleEvent evt,
                                    java.io.Writer writer)
                             throws java.io.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:
java.io.IOException

saveTestElement

public static void saveTestElement(TestElement elem,
                                   java.io.Writer writer)
                            throws java.io.IOException
Parameters:
elem - test element
writer - output stream which must be created using getFileEncoding(String)
Throws:
java.io.IOException

loadTestResults

public static void loadTestResults(java.io.InputStream reader,
                                   ResultCollectorHelper resultCollectorHelper)
                            throws java.lang.Exception
Read results from JTL file.

Parameters:
reader - of the file
resultCollectorHelper - helper class to enable TestResultWrapperConverter to deliver the samples
Throws:
java.lang.Exception

loadTree

public static HashTree loadTree(java.io.InputStream reader)
                         throws java.lang.Exception
Load a Test tree (JMX file)

Parameters:
reader - on the JMX file
Returns:
the loaded tree
Throws:
java.lang.Exception - if there is a problem reading the file or processing it

getFileEncoding

public static java.lang.String getFileEncoding(java.lang.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

isSaveTestPlanFormat20

public static boolean isSaveTestPlanFormat20()

isSaveTestLogFormat20

public static boolean isSaveTestLogFormat20()

isSaveTestPlanFormat22

public static boolean isSaveTestPlanFormat22()

CEtoString

public static java.lang.String CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionException

Parameters:
ce - - ConversionException to analyse
Returns:
string with details of error

getPropertiesVersion

public static java.lang.String getPropertiesVersion()

getVERSION

public static java.lang.String getVERSION()

Apache JMeter

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