Class TestResults
java.lang.Object
com.atlassian.bamboo.results.tests.TestResults
- All Implemented Interfaces:
Serializable
,Comparable<TestResults>
This class is a POJO for representing unit test results.
- See Also:
-
Constructor Summary
ConstructorDescriptionTestResults
(String className, String methodName, @Nullable Long durationMs) Create a new testTestResults
(String className, String methodName, String duration) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(TestCaseResultError error) Add an error to the testint
boolean
Returns the actual method name without the pretty spaces@NotNull String
The name of the classlong
How long did the test take to execute?How many errors does the test have.@Nullable String
Returns a sentence describing the test, derived from the method name of the test.Deprecated.since 5.9 without replacement@NotNull String
The short name of the classgetState()
long
boolean
int
hashCode()
static @Nullable String
methodNameToDescription
(String methodName) Attempts to convert a test method name to a sentence describing the test.void
void
setSystemOut
(String systemOut) void
setTestCaseId
(long testCaseId) toString()
-
Constructor Details
-
TestResults
Deprecated.since 5.10 use $TestResults(String, String, Long)
Create a new test- Parameters:
className
- The name of the class containing the testmethodName
- The name of the testduration
- The time the test took to execute in seconds
-
TestResults
Create a new test- Parameters:
className
- The name of the class containing the testmethodName
- The name of the testdurationMs
- The time the test took to execute in milliseconds
-
-
Method Details
-
getActualMethodName
Returns the actual method name without the pretty spaces- Returns:
- the raw method name
-
getMethodName
Returns a sentence describing the test, derived from the method name of the test.
- Returns:
- The sentence
-
methodNameToDescription
Attempts to convert a test method name to a sentence describing the test. "testManualTriggering works" becomes "Manual triggering works" -
getClassName
The name of the class- Returns:
- The class name
-
getShortClassName
The short name of the class- Returns:
-
getDurationMs
public long getDurationMs()How long did the test take to execute?- Returns:
- the length of the test in milliseconds
-
addError
Add an error to the test- Parameters:
error
- a new error
-
getErrors
How many errors does the test have.- Returns:
- The collection of errors. An empty list is returned is there are no errors.
-
setSystemOut
-
getSystemOut
-
hasErrors
public boolean hasErrors() -
getPrettyDuration
Deprecated.since 5.9 without replacement -
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TestResults>
-
getState
-
setState
-
getTestCaseId
public long getTestCaseId() -
setTestCaseId
public void setTestCaseId(long testCaseId)
-
TestResults(String, String, Long)