org.apache.jmeter.save

Class SaveService


public class SaveService
extends Object

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

Field Summary

static String
RESULTCOLLECTOR_HELPER_OBJECT
static String
SAMPLE_EVENT_OBJECT
static String
TESTLOG_FORMAT
static String
TESTPLAN_FORMAT

Method Summary

static String
CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionException
static String
aliasToClass(String s)
static String
classToAlias(String s)
static String
getFileEncoding(String dflt)
Returns the file Encoding specified in saveservice.properties or the default
static String
getPropertiesVersion()
static String
getVERSION()
static boolean
isSaveTestLogFormat20()
static boolean
isSaveTestPlanFormat20()
static boolean
isSaveTestPlanFormat22()
static Object
loadElement(InputStream in)
static Properties
loadProperties()
static void
loadTestResults(InputStream reader, ResultCollectorHelper resultCollectorHelper)
Read results from JTL file.
static HashTree
loadTree(InputStream reader)
Load a Test tree (JMX file)
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

RESULTCOLLECTOR_HELPER_OBJECT

public static final String RESULTCOLLECTOR_HELPER_OBJECT

SAMPLE_EVENT_OBJECT

public static final String SAMPLE_EVENT_OBJECT

TESTLOG_FORMAT

public static final String TESTLOG_FORMAT

TESTPLAN_FORMAT

public static final String TESTPLAN_FORMAT

Method Details

CEtoString

public static String CEtoString(ConversionException ce)
Simplify getMessage() output from XStream ConversionException
Parameters:
ce - - ConversionException to analyse
Returns:
string with details of error

aliasToClass

public static String aliasToClass(String s)

classToAlias

public static String classToAlias(String s)

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

getPropertiesVersion

public static String getPropertiesVersion()

getVERSION

public static String getVERSION()

isSaveTestLogFormat20

public static boolean isSaveTestLogFormat20()

isSaveTestPlanFormat20

public static boolean isSaveTestPlanFormat20()

isSaveTestPlanFormat22

public static boolean isSaveTestPlanFormat22()

loadElement

public static Object loadElement(InputStream in)
            throws IOException

loadProperties

public static Properties loadProperties()
            throws IOException

loadTestResults

public static void loadTestResults(InputStream reader,
                                   ResultCollectorHelper resultCollectorHelper)
            throws Exception
Read results from JTL file.
Parameters:
reader - of the file
resultCollectorHelper - helper class to enable TestResultWrapperConverter to deliver the samples

loadTree

public static HashTree loadTree(InputStream reader)
            throws Exception
Load a Test tree (JMX file)
Parameters:
reader - on the JMX file
Returns:
the loaded tree

saveElement

public static void saveElement(Object el,
                               OutputStream out)
            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)

saveTestElement

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

saveTree

public static void saveTree(HashTree tree,
                            OutputStream out)
            throws IOException

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