Package org.apache.jmeter.save
Class SaveService
java.lang.Object
org.apache.jmeter.save.SaveService
Handles setting up XStream serialisation.
The class reads alias definitions from saveservice.properties.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
CEtoString
(ConversionException ce) Simplify getMessage() output from XStream ConversionExceptionstatic String
static String
getFileEncoding
(String dflt) Returns the file Encoding specified in saveservice.properties or the defaultstatic String
static String
static Object
static Properties
static void
loadTestResults
(InputStream reader, ResultCollectorHelper resultCollectorHelper) Read results from JTL file.static HashTree
Load a Test tree (JMX file)static HashTree
loadTree
(InputStream reader) Deprecated.static void
saveElement
(Object el, OutputStream out) static void
saveSampleResult
(SampleEvent evt, Writer writer) Save a sampleResult to an XML output file using XStream.static void
saveTestElement
(TestElement elem, Writer writer) static void
saveTree
(HashTree tree, OutputStream out)
-
Field Details
-
SAMPLE_EVENT_OBJECT
- See Also:
-
RESULTCOLLECTOR_HELPER_OBJECT
- See Also:
-
TEST_CLASS_NAME
- See Also:
-
TESTPLAN_FORMAT
-
TESTLOG_FORMAT
-
IS_TESTPLAN_FORMAT_22
public static final boolean IS_TESTPLAN_FORMAT_22New XStream format - more compressed class names
-
-
Constructor Details
-
SaveService
public SaveService()
-
-
Method Details
-
loadProperties
- Throws:
IOException
-
aliasToClass
-
classToAlias
-
saveTree
- Throws:
IOException
-
saveElement
- Throws:
IOException
-
loadElement
- Throws:
IOException
-
saveSampleResult
Save a sampleResult to an XML output file using XStream.- Parameters:
evt
- sampleResult wrapped in a sampleEventwriter
- output stream which must be created usinggetFileEncoding(String)
- Throws:
IOException
- when writing data to output fails
-
saveTestElement
- Parameters:
elem
- test elementwriter
- output stream which must be created usinggetFileEncoding(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 fileresultCollectorHelper
- helper class to enable TestResultWrapperConverter to deliver the samples- Throws:
IOException
- if an I/O error occurs
-
loadTree
Deprecated.Load a Test tree (JMX file)- Parameters:
reader
- the JMX file as anInputStream
- Returns:
- the loaded tree or null if an error occurs
- Throws:
IOException
- if there is a problem reading the file or processing it
-
loadTree
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
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
Simplify getMessage() output from XStream ConversionException- Parameters:
ce
- - ConversionException to analyse- Returns:
- string with details of error
-
getPropertiesVersion
-
getVERSION
-
SaveService
loadTree(File)