Class SampleResultConverter
- java.lang.Object
-
- AbstractCollectionConverter
-
- org.apache.jmeter.save.converters.SampleResultConverter
-
- Direct Known Subclasses:
HTTPResultConverter
public class SampleResultConverter extends AbstractCollectionConverter
XStream Converter for the SampleResult class
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
TAG_COOKIES
protected static String
TAG_METHOD
protected static String
TAG_QUERY_STRING
protected static String
TAG_REDIRECT_LOCATION
protected static String
TAG_REQUEST_HEADER
protected static String
TAG_RESPONSE_DATA
protected static String
TAG_RESPONSE_FILE
protected static String
TAG_RESPONSE_HEADER
protected static String
TAG_SAMPLER_DATA
-
Constructor Summary
Constructors Constructor Description SampleResultConverter(Mapper arg0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(Class arg0)
static String
getVersion()
Returns the converter version; used to check for possible incompatibilitiesvoid
marshal(Object obj, HierarchicalStreamWriter writer, MarshallingContext context)
protected void
readFile(String resultFileName, SampleResult res)
protected void
retrieveAttributes(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res)
protected boolean
retrieveItem(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res, Object subItem)
protected void
saveAssertions(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save assertion results from the sample result into the streamprotected void
saveRequestHeaders(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save request headers from the sample result into the streamprotected void
saveResponseData(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save the response from the sample result into the streamprotected void
saveResponseHeaders(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save response headers from sample result into the streamprotected void
saveSamplerData(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save the data of the sample result to a streamprotected void
saveSubResults(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save sub results from sample result into the streamprotected void
setAttributes(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save attributes of the sample result to the streamObject
unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
protected void
writeString(HierarchicalStreamWriter writer, String tag, String value)
Write a tag with with a content ofvalue
to thewriter
-
-
-
Field Detail
-
TAG_COOKIES
protected static final String TAG_COOKIES
- See Also:
- Constant Field Values
-
TAG_METHOD
protected static final String TAG_METHOD
- See Also:
- Constant Field Values
-
TAG_QUERY_STRING
protected static final String TAG_QUERY_STRING
- See Also:
- Constant Field Values
-
TAG_REDIRECT_LOCATION
protected static final String TAG_REDIRECT_LOCATION
- See Also:
- Constant Field Values
-
TAG_REQUEST_HEADER
protected static final String TAG_REQUEST_HEADER
- See Also:
- Constant Field Values
-
TAG_RESPONSE_DATA
protected static final String TAG_RESPONSE_DATA
- See Also:
- Constant Field Values
-
TAG_RESPONSE_HEADER
protected static final String TAG_RESPONSE_HEADER
- See Also:
- Constant Field Values
-
TAG_SAMPLER_DATA
protected static final String TAG_SAMPLER_DATA
- See Also:
- Constant Field Values
-
TAG_RESPONSE_FILE
protected static final String TAG_RESPONSE_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
public static String getVersion()
Returns the converter version; used to check for possible incompatibilities- Returns:
- the version of this converter
-
canConvert
public boolean canConvert(Class arg0)
-
marshal
public void marshal(Object obj, HierarchicalStreamWriter writer, MarshallingContext context)
-
saveSamplerData
protected void saveSamplerData(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save the data of the sample result to a stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
saveResponseData
protected void saveResponseData(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save the response from the sample result into the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
saveRequestHeaders
protected void saveRequestHeaders(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save request headers from the sample result into the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
saveResponseHeaders
protected void saveResponseHeaders(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save response headers from sample result into the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
saveSubResults
protected void saveSubResults(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save sub results from sample result into the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
saveAssertions
protected void saveAssertions(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save assertion results from the sample result into the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
setAttributes
protected void setAttributes(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save)
Save attributes of the sample result to the stream- Parameters:
writer
- stream to save objects intocontext
- context for xstream to allow nested objectsres
- sample to be savedsave
- configuration telling us what to save
-
writeString
protected void writeString(HierarchicalStreamWriter writer, String tag, String value)
Write a tag with with a content ofvalue
to thewriter
- Parameters:
writer
- writer to write the tag intotag
- name of the tag to usevalue
- content for tag
-
unmarshal
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
-
retrieveItem
protected boolean retrieveItem(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res, Object subItem)
- Parameters:
reader
- stream from which the objects should be readcontext
- context for xstream to allow nested objectsres
- sample result into which the information should be retrievedsubItem
- sub item which should be added intores
- Returns:
true
if the item was processed (for HTTPResultConverter)
-
retrieveAttributes
protected void retrieveAttributes(HierarchicalStreamReader reader, UnmarshallingContext context, SampleResult res)
- Parameters:
reader
- stream to read objects fromcontext
- context for xstream to allow nested objectsres
- sample result on which the attributes should be set
-
readFile
protected void readFile(String resultFileName, SampleResult res)
-
-