Apache JMeter
1.9

org.apache.jmeter.samplers
Class SampleResult

java.lang.Object
  |
  +--org.apache.jmeter.samplers.SampleResult
All Implemented Interfaces:
Serializable

public class SampleResult
extends Object
implements Serializable

This is a nice packaging for the various information returned from taking a sample of an entry.

Version:
$Revision: 1.8 $
Author:
$Author: jeremy_a $
See Also:
Serialized Form

Field Summary
static String BINARY
          Data type value indicating that the response data is binary.
static String TEXT
          Data type value indicating that the response data is text.
 
Constructor Summary
SampleResult()
           
 
Method Summary
 void addAssertionResult(AssertionResult assertResult)
           
 void addSubResult(SampleResult subResult)
           
 void configure(org.apache.avalon.framework.configuration.Configuration info)
           
 AssertionResult[] getAssertionResults()
          Gets the assertion results associated with this sample.
 String getDataEncoding()
          Returns the dataEncoding.
 String getDataType()
           
 String getResponseCode()
           
 byte[] getResponseData()
          Gets the responseData attribute of the SampleResult object.
 String getResponseMessage()
           
 String getSampleLabel()
           
 String getSamplerData()
           
 SampleResult[] getSubResults()
          Gets the subresults associated with this sample.
 String getThreadName()
           
 long getTime()
          Get the time it took this sample to occur.
 long getTimeStamp()
           
 boolean isMarked(String filename)
           
 boolean isSuccessful()
           
 void setDataEncoding(String dataEncoding)
          Sets the dataEncoding.
 void setDataType(String dataType)
           
 void setMarked(String filename)
           
 void setResponseCode(String code)
           
 void setResponseData(byte[] response)
          Sets the responseData attribute of the SampleResult object.
 void setResponseMessage(String msg)
           
 void setSampleLabel(String label)
           
 void setSamplerData(String s)
           
 void setSuccessful(boolean success)
          Sets the successful attribute of the SampleResult object.
 void setThreadName(String threadName)
           
 void setTime(long t)
          Set the time this sample took to occur.
 void setTimeStamp(long timeStamp)
           
 String toString()
          Returns the display name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT

public static final String TEXT
Data type value indicating that the response data is text.

See Also:
getDataType(), setDataType(java.lang.String), Constant Field Values

BINARY

public static final String BINARY
Data type value indicating that the response data is binary.

See Also:
getDataType(), setDataType(java.lang.String), Constant Field Values
Constructor Detail

SampleResult

public SampleResult()
Method Detail

setMarked

public void setMarked(String filename)

isMarked

public boolean isMarked(String filename)

getResponseCode

public String getResponseCode()

setResponseCode

public void setResponseCode(String code)

getResponseMessage

public String getResponseMessage()

setResponseMessage

public void setResponseMessage(String msg)

getThreadName

public String getThreadName()

setThreadName

public void setThreadName(String threadName)

getTimeStamp

public long getTimeStamp()

setTimeStamp

public void setTimeStamp(long timeStamp)

getSampleLabel

public String getSampleLabel()

setSampleLabel

public void setSampleLabel(String label)

addAssertionResult

public void addAssertionResult(AssertionResult assertResult)

getAssertionResults

public AssertionResult[] getAssertionResults()
Gets the assertion results associated with this sample.

Returns:
an array containing the assertion results for this sample. Returns null if there are no assertion results.

addSubResult

public void addSubResult(SampleResult subResult)

getSubResults

public SampleResult[] getSubResults()
Gets the subresults associated with this sample.

Returns:
an array containing the subresults for this sample. Returns null if there are no subresults.

configure

public void configure(org.apache.avalon.framework.configuration.Configuration info)

setTime

public void setTime(long t)
Set the time this sample took to occur.


setResponseData

public void setResponseData(byte[] response)
Sets the responseData attribute of the SampleResult object.

Parameters:
response - the new responseData value

getResponseData

public byte[] getResponseData()
Gets the responseData attribute of the SampleResult object.

Returns:
the responseData value

setSamplerData

public void setSamplerData(String s)

getSamplerData

public String getSamplerData()

getTime

public long getTime()
Get the time it took this sample to occur.


isSuccessful

public boolean isSuccessful()

setDataType

public void setDataType(String dataType)

getDataType

public String getDataType()

setSuccessful

public void setSuccessful(boolean success)
Sets the successful attribute of the SampleResult object.

Parameters:
success - the new successful value

toString

public String toString()
Returns the display name.

Overrides:
toString in class Object
Returns:
display name of this sample result

getDataEncoding

public String getDataEncoding()
Returns the dataEncoding.


setDataEncoding

public void setDataEncoding(String dataEncoding)
Sets the dataEncoding.

Parameters:
dataEncoding - the dataEncoding to set

Apache JMeter
1.9

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