JTR 5.0 API Documentation

jtr.test.impl
Class DefaultOutcome

java.lang.Object
  extended by jtr.test.impl.DefaultOutcome
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, IOutcome<AbstractRunner>

public class DefaultOutcome
extends java.lang.Object
implements IOutcome<AbstractRunner>, java.io.Serializable

This is the default implementation provided for the IOutcome interface.

Since:
1.0
Version:
5.0
Author:
Francesco Russo (frusso@dev.java.net)
See Also:
IOutcome, IOutcomeFactory, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jtr.test.IOutcome
IOutcome.OutcomeType
 
Constructor Summary
DefaultOutcome()
          Default constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          This reimplementation of the Comparable#compareTo() method returns: -1 iff this.epoch<o.epoch or this.run<o.run 1 iff this.epoch>o.epoch or this.run>o.run 0 otherwise
Note: this class has a natural ordering that is inconsistent with equals.
 EnterpriseConfig getEnterpriseConfig()
          Get the enterprise configuration
 java.lang.Integer getEpoch()
          Get the epoch.
 java.lang.Throwable getException()
          Get the exception
 NodeInfo getNode()
          Return the JTR-node the runner that produced this outcome belongs to.
 ParametersMap getParametersMap()
          Returns the parameters the IRunner was working with at the moment of the exception
 java.lang.Integer getRun()
          Get the run
 java.lang.Long getRunDuration()
          Get the duration of the described run.
 java.lang.Class getRunnerCategory()
          Returns the category the runner that produced this outcome belogns to.
 java.lang.String getRunnerId()
          Returns the unique ID of the runner that produced this outcome.
 java.util.Date getTimeStamp()
          Get the run's timestamp.
 IOutcome.OutcomeType getType()
          Get the type of the outcome
 java.io.Serializable getUserObject()
          Get a user-object that can be used to add any user-defined information to the output of the test.
 boolean isFailure()
          Returs Boolean.TRUE iff the type equals OutcomeType.FAILURE.
 void setEnterpriseConfig(EnterpriseConfig cfg)
          Set the enterprise configuration active at the moment of the exception
 void setEpoch(java.lang.Integer epoch)
          Set the epoch when the exception happened.
 void setException(java.lang.Throwable t)
          Set the exception
 void setNode(NodeInfo node)
          Set the JTR-node the runner that produced this outcome belongs to.
 void setParametersMap(ParametersMap params)
          Sets the parameters the IRunner that experiences the excepion was working with
 void setRun(java.lang.Integer run)
          Set the run when the exception happened
 void setRunDuration(java.lang.Long duration)
          Set the duration of the described run.
 void setRunnerCategory(java.lang.Class<AbstractRunner> category)
          Set the category the runner that produced this outcome belogns to.
 void setRunnerId(java.lang.String id)
          Set the unique ID of the runner that produced this outcome.
 void setTimeStamp(java.util.Date ts)
          Set the timestamp indicating when the run has been started.
 void setType(IOutcome.OutcomeType type)
          Set the type of the outcome
 void setUserObject(java.io.Serializable obj)
          Set a user-object that can be used to add any user-defined information to the output of the test.
 java.lang.String toString()
          A String representation of the current IOutcome instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultOutcome

public DefaultOutcome()
Default constructor.

Method Detail

setEpoch

public void setEpoch(java.lang.Integer epoch)
Set the epoch when the exception happened.

Specified by:
setEpoch in interface IOutcome<AbstractRunner>
Parameters:
epoch - The epoch

getEpoch

public java.lang.Integer getEpoch()
Get the epoch.

Specified by:
getEpoch in interface IOutcome<AbstractRunner>
Returns:
int The epoch of the exception

setRun

public void setRun(java.lang.Integer run)
Set the run when the exception happened

Specified by:
setRun in interface IOutcome<AbstractRunner>
Parameters:
run - The run

getRun

public java.lang.Integer getRun()
Get the run

Specified by:
getRun in interface IOutcome<AbstractRunner>
Returns:
int The run

setEnterpriseConfig

public void setEnterpriseConfig(EnterpriseConfig cfg)
Set the enterprise configuration active at the moment of the exception

Specified by:
setEnterpriseConfig in interface IOutcome<AbstractRunner>
Parameters:
cfg - The enterprise configuration

getEnterpriseConfig

public EnterpriseConfig getEnterpriseConfig()
Get the enterprise configuration

Specified by:
getEnterpriseConfig in interface IOutcome<AbstractRunner>
Returns:
EnterpriseConfig

setParametersMap

public void setParametersMap(ParametersMap params)
Sets the parameters the IRunner that experiences the excepion was working with

Specified by:
setParametersMap in interface IOutcome<AbstractRunner>
Parameters:
params - The IRunner's parameters

getParametersMap

public ParametersMap getParametersMap()
Returns the parameters the IRunner was working with at the moment of the exception

Specified by:
getParametersMap in interface IOutcome<AbstractRunner>
Returns:
ParametersMap

setException

public void setException(java.lang.Throwable t)
Set the exception

Specified by:
setException in interface IOutcome<AbstractRunner>
Parameters:
t - The exception

getException

public java.lang.Throwable getException()
Get the exception

Specified by:
getException in interface IOutcome<AbstractRunner>
Returns:
Throwable The exception

setType

public void setType(IOutcome.OutcomeType type)
Description copied from interface: IOutcome
Set the type of the outcome

Specified by:
setType in interface IOutcome<AbstractRunner>

getType

public IOutcome.OutcomeType getType()
Description copied from interface: IOutcome
Get the type of the outcome

Specified by:
getType in interface IOutcome<AbstractRunner>

isFailure

public boolean isFailure()
Description copied from interface: IOutcome
Returs Boolean.TRUE iff the type equals OutcomeType.FAILURE.

Specified by:
isFailure in interface IOutcome<AbstractRunner>

getRunnerCategory

public java.lang.Class getRunnerCategory()
Description copied from interface: IOutcome
Returns the category the runner that produced this outcome belogns to.

Specified by:
getRunnerCategory in interface IOutcome<AbstractRunner>

getRunnerId

public java.lang.String getRunnerId()
Description copied from interface: IOutcome
Returns the unique ID of the runner that produced this outcome.

Specified by:
getRunnerId in interface IOutcome<AbstractRunner>

setRunnerCategory

public void setRunnerCategory(java.lang.Class<AbstractRunner> category)
Description copied from interface: IOutcome
Set the category the runner that produced this outcome belogns to.

Specified by:
setRunnerCategory in interface IOutcome<AbstractRunner>

setRunnerId

public void setRunnerId(java.lang.String id)
Description copied from interface: IOutcome
Set the unique ID of the runner that produced this outcome.

Specified by:
setRunnerId in interface IOutcome<AbstractRunner>

getNode

public NodeInfo getNode()
Description copied from interface: IOutcome
Return the JTR-node the runner that produced this outcome belongs to.

Specified by:
getNode in interface IOutcome<AbstractRunner>

setNode

public void setNode(NodeInfo node)
Description copied from interface: IOutcome
Set the JTR-node the runner that produced this outcome belongs to.

Specified by:
setNode in interface IOutcome<AbstractRunner>

setRunDuration

public void setRunDuration(java.lang.Long duration)
Description copied from interface: IOutcome
Set the duration of the described run.

Specified by:
setRunDuration in interface IOutcome<AbstractRunner>

getRunDuration

public java.lang.Long getRunDuration()
Description copied from interface: IOutcome
Get the duration of the described run.

Specified by:
getRunDuration in interface IOutcome<AbstractRunner>

setTimeStamp

public void setTimeStamp(java.util.Date ts)
Description copied from interface: IOutcome
Set the timestamp indicating when the run has been started.

Specified by:
setTimeStamp in interface IOutcome<AbstractRunner>

getTimeStamp

public java.util.Date getTimeStamp()
Description copied from interface: IOutcome
Get the run's timestamp.

Specified by:
getTimeStamp in interface IOutcome<AbstractRunner>

setUserObject

public void setUserObject(java.io.Serializable obj)
Description copied from interface: IOutcome
Set a user-object that can be used to add any user-defined information to the output of the test. Every user-object must have a valid toString method implementation too.

Specified by:
setUserObject in interface IOutcome<AbstractRunner>

getUserObject

public java.io.Serializable getUserObject()
Description copied from interface: IOutcome
Get a user-object that can be used to add any user-defined information to the output of the test. Every user-object must have a valid toString method implementation too.

Specified by:
getUserObject in interface IOutcome<AbstractRunner>

compareTo

public int compareTo(java.lang.Object o)
This reimplementation of the Comparable#compareTo() method returns:
  • -1 iff this.epoch<o.epoch or this.run<o.run
  • 1 iff this.epoch>o.epoch or this.run>o.run
  • 0 otherwise

  • Note: this class has a natural ordering that is inconsistent with equals.

    Specified by:
    compareTo in interface java.lang.Comparable
    Parameters:
    o -
    Returns:
    int

    toString

    public java.lang.String toString()
    A String representation of the current IOutcome instance

    Specified by:
    toString in interface IOutcome<AbstractRunner>
    Overrides:
    toString in class java.lang.Object
    Returns:
    String

    The JTR Project is licensed under GPL version 2