com.googlecode.lightest.core
Class TaskResult

java.lang.Object
  extended by com.googlecode.lightest.core.TaskResult
All Implemented Interfaces:
ITaskResult, groovy.lang.GroovyObject

public class TaskResult
extends Object
implements groovy.lang.GroovyObject, ITaskResult

The default implementation of ITaskResult.


Field Summary
 
Fields inherited from interface com.googlecode.lightest.core.ITaskResult
HUMAN_READABLE_STATUS, STATUS_DOOMED, STATUS_FAILED, STATUS_FLAGGED, STATUS_OK
 
Constructor Summary
TaskResult(ITask task)
          Constructs a default task result.
TaskResult(ITask task, ITaskResult parent)
           
 
Method Summary
 void addLink(String link)
          Adds a URL referencing a resource that provides additional information related to this result.
 void addLink(TaskResultLink link)
          Adds a URL referencing a resource that provides additional information related to this result, to a collection maintained by the result object.
 void appendChild(ITaskResult childResult)
          Adds to the list of child task results.
 List children()
          Returns a list of child task results.
 void doom()
          Sets the status of this result to STATUS_DOOMED, which indicates that the failure of the task means the remainder of the test cannot continue successfully, and should be aborted.
 void fail()
          Sets the status of this result to STATUS_FAILED, but only if it is not already STATUS_DOOMED.
 void flag()
          Sets the status of this result to STATUS_FLAGGED, but only if it is not already STATUS_FAILED.
 String getDetailedMessage()
          Returns a detailed message about the task execution, for example, the data generated by performing the task, if any.
 long getEndTime()
          Returns the time the task was finished.
 List getLinks()
          Returns the list of URL's associated with this result.
 String getMessage()
          Returns a message describing the result.
 groovy.lang.MetaClass getMetaClass()
           
 ITaskResult getParent()
          Returns the parent task result.
 Object getProperty(String name)
           
 long getStartTime()
          Returns the time the task was started.
 int getStatus()
          Returns the status of the result.
 ITask getTask()
          Returns the task whose performance returned this result.
 Object invokeMethod(String name, Object args)
           
 void setDetailedMessage(String value)
          Sets the return value of getDetailedMessage().
 void setEndTime(long value)
          Sets the time the task was finished.
 void setMessage(String value)
          Sets the return value of getMessage().
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setParent(ITaskResult value)
          Sets the parent task result.
 void setProperty(String name, Object value)
           
 void setStartTime(long value)
          Sets the time the task was started.
protected  void setStatus(Object newStatus)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskResult

public TaskResult(ITask task)
Constructs a default task result. The default status is always ITaskResult.STATUS_OK .


TaskResult

public TaskResult(ITask task,
                  ITaskResult parent)
Method Detail

getParent

public ITaskResult getParent()
Description copied from interface: ITaskResult
Returns the parent task result.

Specified by:
getParent in interface ITaskResult

setParent

public void setParent(ITaskResult value)
Description copied from interface: ITaskResult
Sets the parent task result.

Specified by:
setParent in interface ITaskResult

getMessage

public String getMessage()
Description copied from interface: ITaskResult
Returns a message describing the result.

Specified by:
getMessage in interface ITaskResult

setMessage

public void setMessage(String value)
Description copied from interface: ITaskResult
Sets the return value of getMessage().

Specified by:
setMessage in interface ITaskResult

getDetailedMessage

public String getDetailedMessage()
Description copied from interface: ITaskResult
Returns a detailed message about the task execution, for example, the data generated by performing the task, if any.

Specified by:
getDetailedMessage in interface ITaskResult

setDetailedMessage

public void setDetailedMessage(String value)
Description copied from interface: ITaskResult
Sets the return value of getDetailedMessage().

Specified by:
setDetailedMessage in interface ITaskResult

getStartTime

public long getStartTime()
Description copied from interface: ITaskResult
Returns the time the task was started.

Specified by:
getStartTime in interface ITaskResult

setStartTime

public void setStartTime(long value)
Description copied from interface: ITaskResult
Sets the time the task was started.

Specified by:
setStartTime in interface ITaskResult

getEndTime

public long getEndTime()
Description copied from interface: ITaskResult
Returns the time the task was finished.

Specified by:
getEndTime in interface ITaskResult

setEndTime

public void setEndTime(long value)
Description copied from interface: ITaskResult
Sets the time the task was finished.

Specified by:
setEndTime in interface ITaskResult

getLinks

public List getLinks()
Returns the list of URL's associated with this result.

Specified by:
getLinks in interface ITaskResult

getStatus

public int getStatus()
Returns the status of the result.

Specified by:
getStatus in interface ITaskResult

getTask

public ITask getTask()
Returns the task whose performance returned this result.

Specified by:
getTask in interface ITaskResult

addLink

public void addLink(String link)
Adds a URL referencing a resource that provides additional information related to this result.

Specified by:
addLink in interface ITaskResult
Parameters:
link - the string representation of the URL to add

addLink

public void addLink(TaskResultLink link)
Description copied from interface: ITaskResult
Adds a URL referencing a resource that provides additional information related to this result, to a collection maintained by the result object.

Specified by:
addLink in interface ITaskResult
Parameters:
link - the link object to add

appendChild

public void appendChild(ITaskResult childResult)
Adds to the list of child task results.

Specified by:
appendChild in interface ITaskResult

children

public List children()
Returns a list of child task results.

Specified by:
children in interface ITaskResult

flag

public void flag()
Sets the status of this result to STATUS_FLAGGED, but only if it is not already STATUS_FAILED. The default status of the task should be STATUS_OK.

Specified by:
flag in interface ITaskResult

fail

public void fail()
Sets the status of this result to STATUS_FAILED, but only if it is not already STATUS_DOOMED. The default status of the task should be STATUS_OK.

Specified by:
fail in interface ITaskResult

doom

public void doom()
Sets the status of this result to STATUS_DOOMED, which indicates that the failure of the task means the remainder of the test cannot continue successfully, and should be aborted.

Specified by:
doom in interface ITaskResult

setStatus

protected void setStatus(Object newStatus)

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2009. All Rights Reserved.