Package org.apache.jmeter.save
Class SaveService
-
- All Implemented Interfaces:
public class SaveService
Handles setting up XStream serialisation. The class reads alias definitions from saveservice.properties.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
SAMPLE_EVENT_OBJECT
public final static String
RESULTCOLLECTOR_HELPER_OBJECT
public final static String
TEST_CLASS_NAME
public static String
propertiesVersion
-
Constructor Summary
Constructors Constructor Description SaveService()
-
Method Summary
Modifier and Type Method Description static String
getPropertiesVersion()
static Properties
loadProperties()
static String
aliasToClass(String s)
static String
classToAlias(String s)
static void
saveTree(HashTree tree, OutputStream out)
static void
saveElement(Object el, OutputStream out)
static Object
loadElement(InputStream in)
static void
saveSampleResult(SampleEvent evt, Writer writer)
Save a sampleResult to an XML output file using XStream. static void
loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper)
Read results from JTL file. static HashTree
loadTree(File file)
Load a Test tree (JMX file) static String
CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionException static String
getVERSION()
static String
getFileEncoding(String dflt)
Returns the file Encoding specified in saveservice. -
-
Method Detail
-
getPropertiesVersion
static String getPropertiesVersion()
-
loadProperties
static Properties loadProperties()
-
aliasToClass
static String aliasToClass(String s)
-
classToAlias
static String classToAlias(String s)
-
saveTree
static void saveTree(HashTree tree, OutputStream out)
-
saveElement
static void saveElement(Object el, OutputStream out)
-
loadElement
static Object loadElement(InputStream in)
-
saveSampleResult
static void saveSampleResult(SampleEvent evt, Writer writer)
Save a sampleResult to an XML output file using XStream.
- Parameters:
evt
- sampleResult wrapped in a sampleEventwriter
- output stream which must be created using getFileEncoding
-
loadTestResults
static void loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper)
Read results from JTL file.
- Parameters:
reader
- of the fileresultCollectorHelper
- helper class to enable TestResultWrapperConverter to deliver the samples
-
loadTree
static HashTree loadTree(File file)
Load a Test tree (JMX file)
- Parameters:
file
- the JMX file- Returns:
the loaded tree
-
CEtoString
static String CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionException
- Parameters:
ce
- - ConversionException to analyse- Returns:
string with details of error
-
getVERSION
static String getVERSION()
-
getFileEncoding
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
-
-
-
-