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
ConstructorsConstructorDescriptionTestResults(String className, String methodName, @Nullable Long durationMs) Create a new testTestResults(String className, String methodName, String duration) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(TestCaseResultError error) Add an error to the testintbooleanReturns the actual method name without the pretty spaces@NotNull StringThe name of the classlongHow long did the test take to execute?How many errors does the test have.@Nullable StringReturns a sentence describing the test, derived from the method name of the test.Deprecated.since 5.9 without replacement@NotNull StringThe short name of the classgetState()longbooleaninthashCode()static @Nullable StringmethodNameToDescription(String methodName) Attempts to convert a test method name to a sentence describing the test.voidvoidsetSystemOut(String systemOut) voidsetTestCaseId(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:
compareToin interfaceComparable<TestResults>
-
getState
-
setState
-
getTestCaseId
public long getTestCaseId() -
setTestCaseId
public void setTestCaseId(long testCaseId)
-
TestResults(String, String, Long)