Apache JMeter

org.apache.jmeter.save
Class OldSaveService

java.lang.Object
  extended byorg.apache.jmeter.save.OldSaveService

public final class OldSaveService
extends Object

This class provides a means for saving test results. Test results are typically saved in an XML file, but other storage mechanisms may also be used, for instance, CSV files or databases.

Version:
$Revision: 539749 $ $Date: 2007-05-19 14:12:45 +0100 (Sat, 19 May 2007) $

Method Summary
static TestElement createTestElement(org.apache.avalon.framework.configuration.Configuration config)
           
static AssertionResult getAssertionResult(org.apache.avalon.framework.configuration.Configuration config)
           
static byte[] getBinaryData(org.apache.avalon.framework.configuration.Configuration config)
           
static org.apache.avalon.framework.configuration.Configuration getConfigForTestElement(String named, TestElement item)
           
static org.apache.avalon.framework.configuration.Configuration getConfiguration(AssertionResult assResult)
           
static org.apache.avalon.framework.configuration.Configuration getConfiguration(byte[] bin)
           
static org.apache.avalon.framework.configuration.Configuration getConfiguration(SampleResult result, SampleSaveConfiguration saveConfig)
          This method determines the content of the result data that will be stored.
static SampleResult getSampleResult(org.apache.avalon.framework.configuration.Configuration config)
           
static SampleSaveConfiguration getSampleSaveConfiguration(String headerLine)
          Parse a CSV header line
static HashTree loadSubTree(InputStream in)
           
static SampleResult makeResultFromDelimitedString(String inputLine, SampleSaveConfiguration saveConfig, long lineNumber)
          Make a SampleResult given a delimited string.
static String printableFieldNamesToString()
          Generates the field names for the output file
static String printableFieldNamesToString(SampleSaveConfiguration saveConfig)
          Generates the field names for the output file
static String resultToDelimitedString(SampleResult sample)
          Convert a result into a string, where the fields of the result are separated by the default delimiter.
static String resultToDelimitedString(SampleResult sample, String delimiter)
          Convert a result into a string, where the fields of the result are separated by a specified String.
static void saveCSVStats(Vector data, FileWriter writer)
          Method will save aggregate statistics as CSV.
static void saveSubTree(HashTree subTree, OutputStream writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeResultFromDelimitedString

public static SampleResult makeResultFromDelimitedString(String inputLine,
                                                         SampleSaveConfiguration saveConfig,
                                                         long lineNumber)
Make a SampleResult given a delimited string.

Parameters:
inputLine - - line from CSV file
saveConfig - - configuration
lineNumber - - line number for error reporting
Returns:
SampleResult or null if header line detected
Throws:
JMeterError

printableFieldNamesToString

public static String printableFieldNamesToString()
Generates the field names for the output file

Returns:
the field names as a string

printableFieldNamesToString

public static String printableFieldNamesToString(SampleSaveConfiguration saveConfig)
Generates the field names for the output file

Returns:
the field names as a string

getSampleSaveConfiguration

public static SampleSaveConfiguration getSampleSaveConfiguration(String headerLine)
Parse a CSV header line

Parameters:
headerLine - from CSV file
Returns:
config corresponding to the header items found or null if not a header line

saveCSVStats

public static void saveCSVStats(Vector data,
                                FileWriter writer)
                         throws IOException
Method will save aggregate statistics as CSV. For now I put it here. Not sure if it should go in the newer SaveService instead of here. if we ever decide to get rid of this class, we'll need to move this method to the new save service.

Parameters:
data -
writer -
Throws:
IOException

resultToDelimitedString

public static String resultToDelimitedString(SampleResult sample)
Convert a result into a string, where the fields of the result are separated by the default delimiter.

Parameters:
sample - the test result to be converted
Returns:
the separated value representation of the result

resultToDelimitedString

public static String resultToDelimitedString(SampleResult sample,
                                             String delimiter)
Convert a result into a string, where the fields of the result are separated by a specified String.

Parameters:
sample - the test result to be converted
delimiter - the separation string
Returns:
the separated value representation of the result

saveSubTree

public static void saveSubTree(HashTree subTree,
                               OutputStream writer)
                        throws IOException
Throws:
IOException

getSampleResult

public static SampleResult getSampleResult(org.apache.avalon.framework.configuration.Configuration config)

getConfiguration

public static org.apache.avalon.framework.configuration.Configuration getConfiguration(byte[] bin)

getBinaryData

public static byte[] getBinaryData(org.apache.avalon.framework.configuration.Configuration config)

getAssertionResult

public static AssertionResult getAssertionResult(org.apache.avalon.framework.configuration.Configuration config)

getConfiguration

public static org.apache.avalon.framework.configuration.Configuration getConfiguration(AssertionResult assResult)

getConfiguration

public static org.apache.avalon.framework.configuration.Configuration getConfiguration(SampleResult result,
                                                                                       SampleSaveConfiguration saveConfig)
This method determines the content of the result data that will be stored.

Parameters:
result - the object containing all of the data that has been collected.

getConfigForTestElement

public static org.apache.avalon.framework.configuration.Configuration getConfigForTestElement(String named,
                                                                                              TestElement item)

loadSubTree

public static HashTree loadSubTree(InputStream in)
                            throws IOException
Throws:
IOException

createTestElement

public static TestElement createTestElement(org.apache.avalon.framework.configuration.Configuration config)
                                     throws org.apache.avalon.framework.configuration.ConfigurationException,
                                            ClassNotFoundException,
                                            IllegalAccessException,
                                            InstantiationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
ClassNotFoundException
IllegalAccessException
InstantiationException

Apache JMeter

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