Package org.apache.jmeter.save
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 Summary
Fields Modifier and Type Field Description static boolean
IS_TESTPLAN_FORMAT_22
New XStream format - more compressed class namesstatic String
RESULTCOLLECTOR_HELPER_OBJECT
static String
SAMPLE_EVENT_OBJECT
static String
TEST_CLASS_NAME
static String
TESTLOG_FORMAT
static String
TESTPLAN_FORMAT
-
Constructor Summary
Constructors Constructor Description SaveService()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
aliasToClass(String s)
static String
CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionExceptionstatic String
classToAlias(String s)
static String
getFileEncoding(String dflt)
Returns the file Encoding specified in saveservice.properties or the defaultstatic String
getPropertiesVersion()
static String
getVERSION()
static Object
loadElement(InputStream in)
static Properties
loadProperties()
static void
loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper)
Read results from JTL file.static HashTree
loadTree(File file)
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 Detail
-
SAMPLE_EVENT_OBJECT
public static final String SAMPLE_EVENT_OBJECT
- See Also:
- Constant Field Values
-
RESULTCOLLECTOR_HELPER_OBJECT
public static final String RESULTCOLLECTOR_HELPER_OBJECT
- See Also:
- Constant Field Values
-
TEST_CLASS_NAME
public static final String TEST_CLASS_NAME
- See Also:
- Constant Field Values
-
TESTPLAN_FORMAT
public static final String TESTPLAN_FORMAT
-
TESTLOG_FORMAT
public static final String TESTLOG_FORMAT
-
IS_TESTPLAN_FORMAT_22
public static final boolean IS_TESTPLAN_FORMAT_22
New XStream format - more compressed class names
-
-
Method Detail
-
loadProperties
public static Properties loadProperties() throws IOException
- Throws:
IOException
-
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 sampleEventwriter
- output stream which must be created usinggetFileEncoding(String)
- Throws:
IOException
- when writing data to output fails
-
saveTestElement
public static void saveTestElement(TestElement elem, Writer writer) throws IOException
- 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
public static HashTree loadTree(InputStream reader) throws IOException
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
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(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()
-
-