net.sf.jameleon.result
Class JameleonTestResult

java.lang.Object
  extended by net.sf.jameleon.result.JameleonTestResult
All Implemented Interfaces:
Serializable, XMLable, LocationAware
Direct Known Subclasses:
FunctionResult, TestResultWithChildren

public abstract class JameleonTestResult
extends Object
implements XMLable, LocationAware

An abstract Test Result. Generic toXML and

See Also:
Serialized Form

Field Summary
protected  int columnNumber
           
static String E_CDATA
          Syntax for closing cdata value
protected  String elementTagName
           
protected  Throwable error
          The stack trace from the failure if one occured
protected  File errorFile
          The file that contains the display of the error
protected  long executionTime
          The time it took to execute the entire test step
protected  boolean failed
          Whether this result failed or not
protected  int lineNumber
           
protected  HasChildResults parentResults
          The parent results
static String S_CDATA
          Syntax for opening cdata value
protected  String scriptFileName
           
protected  FunctionalPoint tag
          The tag that this result represents
 
Constructor Summary
JameleonTestResult()
          Default Constructor - Does nothing
JameleonTestResult(FunctionalPoint tag)
          Constructor
JameleonTestResult(FunctionalPoint tag, HasChildResults parentResults)
          Constructor
 
Method Summary
 void copyLocationAwareProperties(LocationAware la)
           
 void destroy()
           
 boolean equals(Object obj)
           
protected  String escapeXML(String text)
           
 boolean failed()
           
 JameleonTestResult findAncestorByClass(Class clzz)
           
 int getColumnNumber()
           
 Calendar getDateTimeExecuted()
          Gets the date and time this result was executed
 String getElementName()
           
 Throwable getError()
           
 File getErrorFile()
           
 String getErrorMsg()
           
 long getExecutionTime()
           
 String getExecutionTimeToDisplay()
           
 int getFailedRowNum()
           
 String getFileName()
           
 String getHtmlFormattedErrorMsg()
           
 String getHtmlFormattedStackTrace()
          Gets the stack trace of the error formatted HTML-friendly
 String getIdentifier()
           
 int getLineNumber()
           
 String getOutcome()
           
 HasChildResults getParentResults()
          Gets the parent results
 FunctionalPoint getTag()
          Gets the tag that is tied to the results
abstract  boolean hasChildren()
          Tells whether this result has children or not.
 int hashCode()
           
 boolean isA(String clss)
           
abstract  boolean isDataDriven()
          Tells whether this result is data driven or not.
abstract  boolean isParent()
          Tells whether this result is a parent result or not.
 boolean passed()
           
 void recordFailureToCountableResult()
           
 void setColumnNumber(int columnNumber)
          Sets the column number of the tag
 void setDateTimeExecuted(Calendar dateTimeExecuted)
          Sets the date and time this result was executed
 void setElementName(String elementName)
          Sets the element name which caused the problem
 void setError(Throwable error)
          Sets the error of the function point if one occured
 void setErrorFile(File errorFile)
          Sets the file that contains the display of the error
 void setExecutionTime(long executionTime)
          Set the execution time
 void setFailed()
           
 void setFileName(String fileName)
          Sets the Jelly file which caused the problem
 void setLineNumber(int lineNumber)
          Sets the line number of the tag
 void setParentResults(HasChildResults parentResults)
          Sets the parent results
 void setTag(FunctionalPoint tag)
          Sets the tag that is tied to the results
 String toString()
           
 String toXML()
          Implement this method the same way the toString method would be implemented, except the object's information should be in a valid XML format.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

executionTime

protected long executionTime
The time it took to execute the entire test step


failed

protected boolean failed
Whether this result failed or not


tag

protected FunctionalPoint tag
The tag that this result represents


error

protected Throwable error
The stack trace from the failure if one occured


errorFile

protected File errorFile
The file that contains the display of the error


parentResults

protected HasChildResults parentResults
The parent results


S_CDATA

public static final String S_CDATA
Syntax for opening cdata value

See Also:
Constant Field Values

E_CDATA

public static final String E_CDATA
Syntax for closing cdata value

See Also:
Constant Field Values

lineNumber

protected int lineNumber

columnNumber

protected int columnNumber

scriptFileName

protected String scriptFileName

elementTagName

protected String elementTagName
Constructor Detail

JameleonTestResult

public JameleonTestResult()
Default Constructor - Does nothing


JameleonTestResult

public JameleonTestResult(FunctionalPoint tag)
Constructor

Parameters:
tag - - the tag of the restults

JameleonTestResult

public JameleonTestResult(FunctionalPoint tag,
                          HasChildResults parentResults)
Constructor

Parameters:
tag - - the tag of the restults
parentResults - - the results which are parents to this result
Method Detail

destroy

public void destroy()

getError

public Throwable getError()
Returns:
the error that occured

setError

public void setError(Throwable error)
Sets the error of the function point if one occured

Parameters:
error - - The error of the function point if one occured

findAncestorByClass

public JameleonTestResult findAncestorByClass(Class clzz)

getFailedRowNum

public int getFailedRowNum()

recordFailureToCountableResult

public void recordFailureToCountableResult()

getErrorMsg

public String getErrorMsg()
Returns:
the stack trace stating was happened

getHtmlFormattedErrorMsg

public String getHtmlFormattedErrorMsg()
Returns:
the stack trace stating was happened

getHtmlFormattedStackTrace

public String getHtmlFormattedStackTrace()
Gets the stack trace of the error formatted HTML-friendly

Returns:
an html formatted stack trace

getExecutionTime

public long getExecutionTime()
Returns:
the time it took to run this step

getExecutionTimeToDisplay

public String getExecutionTimeToDisplay()
Returns:
the time it took to run this step

setExecutionTime

public void setExecutionTime(long executionTime)
Set the execution time

Parameters:
executionTime - - The time it took to run this step

getErrorFile

public File getErrorFile()
Returns:
The file that contains the display of the error

setErrorFile

public void setErrorFile(File errorFile)
Sets the file that contains the display of the error

Parameters:
errorFile - - The file that contains the display of the error

getIdentifier

public String getIdentifier()

setFailed

public void setFailed()

getOutcome

public String getOutcome()

isParent

public abstract boolean isParent()
Tells whether this result is a parent result or not.

Returns:
true if this result is a parent result or false if it is a leaf node result

isDataDriven

public abstract boolean isDataDriven()
Tells whether this result is data driven or not.

Returns:
true if this result is a data driven result or false if it is not.

hasChildren

public abstract boolean hasChildren()
Tells whether this result has children or not.

Returns:
true if this result has children

getParentResults

public HasChildResults getParentResults()
Gets the parent results

Returns:
The parent result of this result

setParentResults

public void setParentResults(HasChildResults parentResults)
Sets the parent results

Parameters:
parentResults - - the parent results of this result

getTag

public FunctionalPoint getTag()
Gets the tag that is tied to the results

Returns:
The tag that is tied to the results

setTag

public void setTag(FunctionalPoint tag)
Sets the tag that is tied to the results

Parameters:
tag - - The tag that the result is tried to

passed

public boolean passed()
Returns:
true if no errors happened and no asserts failed and at least one asserts were executed

failed

public boolean failed()
Returns:
true if any errors happened or any asserts failed

escapeXML

protected String escapeXML(String text)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toXML

public String toXML()
Description copied from interface: XMLable
Implement this method the same way the toString method would be implemented, except the object's information should be in a valid XML format.

Specified by:
toXML in interface XMLable

copyLocationAwareProperties

public void copyLocationAwareProperties(LocationAware la)

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface LocationAware
Returns:
the line number of the tag

setLineNumber

public void setLineNumber(int lineNumber)
Sets the line number of the tag

Specified by:
setLineNumber in interface LocationAware

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface LocationAware
Returns:
the column number of the tag

setColumnNumber

public void setColumnNumber(int columnNumber)
Sets the column number of the tag

Specified by:
setColumnNumber in interface LocationAware

getFileName

public String getFileName()
Specified by:
getFileName in interface LocationAware
Returns:
the Jelly file which caused the problem

setFileName

public void setFileName(String fileName)
Sets the Jelly file which caused the problem

Specified by:
setFileName in interface LocationAware

getElementName

public String getElementName()
Specified by:
getElementName in interface LocationAware
Returns:
the element name which caused the problem

getDateTimeExecuted

public Calendar getDateTimeExecuted()
Gets the date and time this result was executed

Returns:
The date and time this result was executed

setDateTimeExecuted

public void setDateTimeExecuted(Calendar dateTimeExecuted)
Sets the date and time this result was executed

Parameters:
dateTimeExecuted - The date and time this result was executed

setElementName

public void setElementName(String elementName)
Sets the element name which caused the problem

Specified by:
setElementName in interface LocationAware

isA

public boolean isA(String clss)


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.