Class SampleResultConverter
java.lang.Object
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
org.apache.jmeter.save.converters.SampleResultConverter
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter
,com.thoughtworks.xstream.converters.ConverterMatcher
- Direct Known Subclasses:
HTTPResultConverter
public class SampleResultConverter
extends com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
XStream Converter for the SampleResult class
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Class arg0) static String
Returns the converter version; used to check for possible incompatibilitiesvoid
marshal
(Object obj, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) protected void
readFile
(String resultFileName, SampleResult res) protected void
retrieveAttributes
(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, SampleResult res) protected boolean
retrieveItem
(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context, SampleResult res, Object subItem) protected void
saveAssertions
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save assertion results from the sample result into the streamprotected void
saveRequestHeaders
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save request headers from the sample result into the streamprotected void
saveResponseData
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save the response from the sample result into the streamprotected void
saveResponseHeaders
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save response headers from sample result into the streamprotected void
saveSamplerData
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save the data of the sample result to a streamprotected void
saveSubResults
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save sub results from sample result into the streamprotected void
setAttributes
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context, SampleResult res, SampleSaveConfiguration save) Save attributes of the sample result to the streamunmarshal
(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) protected void
writeString
(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, String tag, String value) Write a tag with a content ofvalue
to thewriter
Methods inherited from class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
createCollection, mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
-
Field Details
-
TAG_COOKIES
- See Also:
-
TAG_METHOD
- See Also:
-
TAG_QUERY_STRING
- See Also:
-
TAG_REDIRECT_LOCATION
- See Also:
-
TAG_REQUEST_HEADER
- See Also:
-
TAG_RESPONSE_DATA
- See Also:
-
TAG_RESPONSE_HEADER
- See Also:
-
TAG_SAMPLER_DATA
- See Also:
-
TAG_RESPONSE_FILE
- See Also:
-
-
Constructor Details
-
SampleResultConverter
public SampleResultConverter(com.thoughtworks.xstream.mapper.Mapper arg0) - Parameters:
arg0
- the mapper
-
-
Method Details
-
getVersion
Returns the converter version; used to check for possible incompatibilities- Returns:
- the version of this converter
-
canConvert
- Specified by:
canConvert
in interfacecom.thoughtworks.xstream.converters.ConverterMatcher
- Specified by:
canConvert
in classcom.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
-
marshal
public void marshal(Object obj, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) - Specified by:
marshal
in interfacecom.thoughtworks.xstream.converters.Converter
- Specified by:
marshal
in classcom.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
-
saveSamplerData
protected void saveSamplerData(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, String tag, String value) Write a tag 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(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context) - Specified by:
unmarshal
in interfacecom.thoughtworks.xstream.converters.Converter
- Specified by:
unmarshal
in classcom.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
-
retrieveItem
protected boolean retrieveItem(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.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(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.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
-