Class TestCaseResultImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.hibernate.HibernateBambooEntityObject
-
- com.atlassian.bamboo.resultsummary.tests.TestCaseResultImpl
-
- All Implemented Interfaces:
BambooIdProvider
,BambooObject
,TestCaseResult
,NameProvider
,Cloneable
,Comparable<TestCaseResult>
@Entity public class TestCaseResultImpl extends HibernateBambooEntityObject implements TestCaseResult
-
-
Constructor Summary
Constructors Constructor Description TestCaseResultImpl()
TestCaseResultImpl(TestCase testCase, long duration, TestState state)
TestCaseResultImpl(TestCase testCase, long duration, TestState state, @Nullable List<TestCaseResultError> testCaseResultErrors)
TestCaseResultImpl(TestCase testCase, long duration, TestState state, @Nullable List<TestCaseResultError> testCaseResultErrors, List<String> quarantinedTests)
Deprecated.since 5.7TestCaseResultImpl(TestCase testCase, long duration, TestState state, @Nullable List<TestCaseResultError> testCaseResultErrors, Set<String> quarantinedTests)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TestCaseResult testCaseResult)
boolean
equals(Object o)
TestDeltaState
getDeltaState()
Return the Delta state for this test, e.g.long
getDuration()
How long the test took to run@NotNull List<TestCaseResultError>
getErrors()
int
getFailingSince()
If in delta state FAILING, return the build number for the build that this test started failing in.@Nullable String
getMethodName()
@Nullable String
getName()
String
getPrettyDuration()
TestState
getState()
Get the state of this test run, e.g.TestCase
getTestCase()
TestClassResult
getTestClassResult()
int
hashCode()
boolean
isQuarantined()
Check if the test case result was quarantinedvoid
setDeltaState(TestDeltaState testDeltaState)
Set the delta state for this test (the difference between the state of this test and the state in the last build)void
setDuration(long duration)
void
setFailingSince(int buildNumber)
Set the build number for the build that this test started failing in.void
setQuarantined(boolean quarantined)
void
setState(TestState state)
void
setTestCase(TestCase testCase)
void
setTestClassResult(TestClassResult testClassResult)
Set the TestClassResult this test result belongs to-
Methods inherited from class com.atlassian.bamboo.hibernate.HibernateBambooEntityObject
getId, setId
-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
-
-
-
Constructor Detail
-
TestCaseResultImpl
public TestCaseResultImpl()
-
TestCaseResultImpl
public TestCaseResultImpl(TestCase testCase, long duration, TestState state, @Nullable @Nullable List<TestCaseResultError> testCaseResultErrors)
-
TestCaseResultImpl
@Deprecated public TestCaseResultImpl(TestCase testCase, long duration, TestState state, @Nullable @Nullable List<TestCaseResultError> testCaseResultErrors, List<String> quarantinedTests)
Deprecated.since 5.7
-
-
Method Detail
-
getName
@Nullable public @Nullable String getName()
- Specified by:
getName
in interfaceNameProvider
- Specified by:
getName
in interfaceTestCaseResult
- Returns:
- the name of the TestCase if available
-
getMethodName
@Nullable public @Nullable String getMethodName()
- Specified by:
getMethodName
in interfaceTestCaseResult
- Returns:
- the user friendly view of the TestCase if available.
-
getPrettyDuration
public String getPrettyDuration()
- Specified by:
getPrettyDuration
in interfaceTestCaseResult
- Returns:
- a user friendly view of the duration.
-
getTestCase
public TestCase getTestCase()
- Specified by:
getTestCase
in interfaceTestCaseResult
- Returns:
- The
TestCase
this result belongs to
-
setTestCase
public void setTestCase(TestCase testCase)
-
getDuration
public long getDuration()
Description copied from interface:TestCaseResult
How long the test took to run- Specified by:
getDuration
in interfaceTestCaseResult
- Returns:
- duration of the TestCase in milliseconds
-
setDuration
public void setDuration(long duration)
-
getTestClassResult
public TestClassResult getTestClassResult()
- Specified by:
getTestClassResult
in interfaceTestCaseResult
- Returns:
- The testClassResult this result is part of
-
setTestClassResult
public void setTestClassResult(TestClassResult testClassResult)
Description copied from interface:TestCaseResult
Set the TestClassResult this test result belongs to- Specified by:
setTestClassResult
in interfaceTestCaseResult
- Parameters:
testClassResult
- this test result belongs to
-
getErrors
@NotNull public @NotNull List<TestCaseResultError> getErrors()
- Specified by:
getErrors
in interfaceTestCaseResult
- Returns:
- Any errors the test generated
-
getState
public TestState getState()
Description copied from interface:TestCaseResult
Get the state of this test run, e.g. FAILED or SUCCESS- Specified by:
getState
in interfaceTestCaseResult
- Returns:
- the state of this test run.
-
setState
public void setState(TestState state)
-
getDeltaState
public TestDeltaState getDeltaState()
Description copied from interface:TestCaseResult
Return the Delta state for this test, e.g. fixed or broken- Specified by:
getDeltaState
in interfaceTestCaseResult
- Returns:
- DeltaState
-
setDeltaState
public void setDeltaState(TestDeltaState testDeltaState)
Description copied from interface:TestCaseResult
Set the delta state for this test (the difference between the state of this test and the state in the last build)- Specified by:
setDeltaState
in interfaceTestCaseResult
- Parameters:
testDeltaState
- - the delta state for this test
-
getFailingSince
public int getFailingSince()
Description copied from interface:TestCaseResult
If in delta state FAILING, return the build number for the build that this test started failing in. If the delta state BROKEN, return the build numver this test was run in. If in delta state FIXED, return the build number at the beginning of the failure span that was fixed. Otherwise it will be -1.- Specified by:
getFailingSince
in interfaceTestCaseResult
- Returns:
- the build number for the build that this test started failing in.
-
setFailingSince
public void setFailingSince(int buildNumber)
Description copied from interface:TestCaseResult
Set the build number for the build that this test started failing in.- Specified by:
setFailingSince
in interfaceTestCaseResult
- Parameters:
buildNumber
- that the test has been failing since
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
compareTo
public int compareTo(TestCaseResult testCaseResult)
- Specified by:
compareTo
in interfaceComparable<TestCaseResult>
-
isQuarantined
public boolean isQuarantined()
Description copied from interface:TestCaseResult
Check if the test case result was quarantined- Specified by:
isQuarantined
in interfaceTestCaseResult
- Returns:
- true/false quarantine status for this result
-
setQuarantined
public void setQuarantined(boolean quarantined)
-
-