com.atlassian.bamboo.results.tests
Class TestResults

java.lang.Object
  extended by com.atlassian.bamboo.results.tests.TestResults
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TestResults>

public class TestResults
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<TestResults>

This class is a POJO for representing unit test results.

See Also:
Serialized Form

Constructor Summary
TestResults()
           
TestResults(java.lang.String className, java.lang.String methodName, java.lang.String duration)
          Create a new test
 
Method Summary
 void addError(TestCaseResultError error)
          Add an error to the test
 int compareTo(TestResults o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getActualMethodName()
          Returns the actual method name without the pretty spaces
 java.lang.String getClassName()
          The name of the class
 java.lang.String getDuration()
          How long did the test take to execute?
 double getDurationInSeconds()
           
 java.util.List<TestCaseResultError> getErrors()
          How many errors does the test have.
 java.lang.String getMethodName()
          Returns a sentence describing the test, derived from the method name of the test.
 java.lang.String getPrettyDuration()
           
 java.lang.String getShortClassName()
          The short name of the class
 TestState getState()
           
 java.lang.String getSystemOut()
           
 long getTestCaseId()
           
 boolean hasErrors()
           
 int hashCode()
           
 void setState(TestState state)
           
 void setSystemOut(java.lang.String systemOut)
           
 void setTestCaseId(long testCaseId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestResults

public TestResults()

TestResults

public TestResults(java.lang.String className,
                   java.lang.String methodName,
                   java.lang.String duration)
Create a new test

Parameters:
className - The name of the class containing the test
methodName - The name of the test
duration - The time the test took to execute in seconds
Method Detail

getActualMethodName

public java.lang.String getActualMethodName()
Returns the actual method name without the pretty spaces

Returns:
the raw method name

getMethodName

public java.lang.String getMethodName()

Returns a sentence describing the test, derived from the method name of the test.

Returns:
The sentence

getClassName

public java.lang.String getClassName()
The name of the class

Returns:
The class name

getShortClassName

public java.lang.String getShortClassName()
The short name of the class

Returns:

getDuration

public java.lang.String getDuration()
How long did the test take to execute?

Returns:
the length of the test in milliseconds

addError

public void addError(TestCaseResultError error)
Add an error to the test

Parameters:
error - a new error

getErrors

public java.util.List<TestCaseResultError> getErrors()
How many errors does the test have.

Returns:
The collection of errors. An empty list is returned is there are no errors.

setSystemOut

public void setSystemOut(java.lang.String systemOut)

getSystemOut

public java.lang.String getSystemOut()

hasErrors

public boolean hasErrors()

getDurationInSeconds

public double getDurationInSeconds()

getPrettyDuration

public java.lang.String getPrettyDuration()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(TestResults o)
Specified by:
compareTo in interface java.lang.Comparable<TestResults>

getState

public TestState getState()

setState

public void setState(TestState state)

getTestCaseId

public long getTestCaseId()

setTestCaseId

public void setTestCaseId(long testCaseId)


Copyright © 2011 Atlassian. All Rights Reserved.