net.sf.jameleon.result
Class TestCaseResult

java.lang.Object
  extended by net.sf.jameleon.result.JameleonTestResult
      extended by net.sf.jameleon.result.TestResultWithChildren
          extended by net.sf.jameleon.result.TestCaseResult
All Implemented Interfaces:
Serializable, CountableResult, HasChildResults, XMLable, LocationAware

public class TestCaseResult
extends TestResultWithChildren
implements CountableResult

An implementation of @see TestResult that keeps track of all of the function point results as well as the the sessio results

See Also:
Serialized Form

Field Summary
protected  boolean countableResultFailed
           
protected  Calendar dateTimeExecuted
           
protected  String testCaseDocsFile
          The name of the test case docs file
protected  String testName
          The name of the test case
 
Fields inherited from class net.sf.jameleon.result.TestResultWithChildren
childrenResults, failedResults
 
Fields inherited from class net.sf.jameleon.result.JameleonTestResult
columnNumber, E_CDATA, elementTagName, error, errorFile, executionTime, failed, lineNumber, parentResults, S_CDATA, scriptFileName, tag
 
Constructor Summary
TestCaseResult()
           
TestCaseResult(FunctionalPoint tag)
           
TestCaseResult(String testName, FunctionalPoint tag)
           
 
Method Summary
 void countFailure()
          Mark this result a failed
 void destroy()
           
 List getCountableResults()
          Gets all the countable ancestor children results that can be counted as test case results
 Calendar getDateTimeExecuted()
          Gets the date and time this result was executed
 List getFailedCountableResults()
          Gets all the failed ancestor children results that can be counted as test case results
 List getFailedResults()
          Gets a list of failed child results
 String getPercentagePassed()
          Gets the percentage total tests passed.
static String getPercentagePassed(int testsRun, int testsFailed)
          Gets the percentage total tests passed.
 String getTestCaseDocsFile()
           
 String getTestName()
           
 boolean isCountableResultFailed()
          Get whether this result failed or not
 boolean isDataDriven()
          Tells whether this result is data driven or not.
 void recordFailureToCountableResult()
           
 void setDateTimeExecuted(Calendar dateTimeExecuted)
          Sets the date and time this result was executed
 void setTestCaseDocsFile(String testCaseDocsFile)
           
 void setTestName(String name)
           
 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 net.sf.jameleon.result.TestResultWithChildren
addChildResult, addFailedResult, getAllChildrenResults, getAllFailedLeafChildrenResults, getChildrenResults, getCountableChildResults, hasChildren, isParent
 
Methods inherited from class net.sf.jameleon.result.JameleonTestResult
copyLocationAwareProperties, equals, escapeXML, failed, findAncestorByClass, getColumnNumber, getElementName, getError, getErrorFile, getErrorMsg, getExecutionTime, getExecutionTimeToDisplay, getFailedRowNum, getFileName, getHtmlFormattedErrorMsg, getHtmlFormattedStackTrace, getIdentifier, getLineNumber, getOutcome, getParentResults, getTag, hashCode, isA, passed, setColumnNumber, setElementName, setError, setErrorFile, setExecutionTime, setFailed, setFileName, setLineNumber, setParentResults, setTag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.jameleon.result.HasChildResults
setFailed
 

Field Detail

testName

protected String testName
The name of the test case


testCaseDocsFile

protected String testCaseDocsFile
The name of the test case docs file


countableResultFailed

protected boolean countableResultFailed

dateTimeExecuted

protected Calendar dateTimeExecuted
Constructor Detail

TestCaseResult

public TestCaseResult()

TestCaseResult

public TestCaseResult(FunctionalPoint tag)

TestCaseResult

public TestCaseResult(String testName,
                      FunctionalPoint tag)
Method Detail

setTestName

public void setTestName(String name)

getTestName

public String getTestName()

getTestCaseDocsFile

public String getTestCaseDocsFile()

setTestCaseDocsFile

public void setTestCaseDocsFile(String testCaseDocsFile)

getDateTimeExecuted

public Calendar getDateTimeExecuted()
Description copied from class: JameleonTestResult
Gets the date and time this result was executed

Overrides:
getDateTimeExecuted in class JameleonTestResult
Returns:
The date and time this result was executed

setDateTimeExecuted

public void setDateTimeExecuted(Calendar dateTimeExecuted)
Description copied from class: JameleonTestResult
Sets the date and time this result was executed

Overrides:
setDateTimeExecuted in class JameleonTestResult
Parameters:
dateTimeExecuted - The date and time this result was executed

getFailedResults

public List getFailedResults()
Gets a list of failed child results

Specified by:
getFailedResults in interface HasChildResults
Overrides:
getFailedResults in class TestResultWithChildren
Returns:
a list of failed child results

destroy

public void destroy()
Overrides:
destroy in class TestResultWithChildren

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
Overrides:
toXML in class TestResultWithChildren
Returns:
an XML representation of the results

getCountableResults

public List getCountableResults()
Description copied from class: TestResultWithChildren
Gets all the countable ancestor children results that can be counted as test case results

Specified by:
getCountableResults in interface HasChildResults
Overrides:
getCountableResults in class TestResultWithChildren
Returns:
List

getFailedCountableResults

public List getFailedCountableResults()
Gets all the failed ancestor children results that can be counted as test case results

Specified by:
getFailedCountableResults in interface HasChildResults
Overrides:
getFailedCountableResults in class TestResultWithChildren
Returns:
List

getPercentagePassed

public String getPercentagePassed()
Gets the percentage total tests passed.

Returns:
the summary for the total tests run, passed and failed.

getPercentagePassed

public static String getPercentagePassed(int testsRun,
                                         int testsFailed)
Gets the percentage total tests passed.

Parameters:
testsRun - The number of tests run
testsFailed - The number of tests failed
Returns:
the percentage total tests passed.

recordFailureToCountableResult

public void recordFailureToCountableResult()
Overrides:
recordFailureToCountableResult in class JameleonTestResult

isDataDriven

public boolean isDataDriven()
Description copied from class: JameleonTestResult
Tells whether this result is data driven or not.

Specified by:
isDataDriven in class JameleonTestResult
Returns:
true if this result is a data driven result or false if it is not.

countFailure

public void countFailure()
Description copied from interface: CountableResult
Mark this result a failed

Specified by:
countFailure in interface CountableResult

isCountableResultFailed

public boolean isCountableResultFailed()
Description copied from interface: CountableResult
Get whether this result failed or not

Specified by:
isCountableResultFailed in interface CountableResult
Returns:
true if the result failed


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