com.atlassian.bamboo.resultsummary.tests
Class TestCaseResultImpl

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.resultsummary.tests.TestCaseResultImpl
All Implemented Interfaces:
BambooIdProvider, BambooObject, TestCaseResult, NameProvider, java.lang.Cloneable, java.lang.Comparable<TestCaseResult>

public class TestCaseResultImpl
extends BambooEntityObject
implements TestCaseResult


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
TestCaseResultImpl()
           
TestCaseResultImpl(TestCase testCase, long duration, TestState state)
           
TestCaseResultImpl(TestCase testCase, long duration, TestState state, java.util.List<TestCaseResultError> testCaseResultErrors)
           
TestCaseResultImpl(TestCase testCase, long duration, TestState state, java.util.List<TestCaseResultError> testCaseResultErrors, java.util.List<java.lang.String> quarantinedTests)
           
 
Method Summary
 int compareTo(TestCaseResult testCaseResult)
           
 boolean equals(java.lang.Object o)
          This method needs to be here in order to use proper id
 TestDeltaState getDeltaState()
          Return the Delta state for this test, e.g.
 long getDuration()
          How long the test took to run
 java.util.List<TestCaseResultError> getErrors()
           
 int getFailingSince()
          If in delta state FAILING, return the build number for the build that this test started failing in.
 java.lang.String getMethodName()
           
 java.lang.String getName()
           
 java.lang.String getPrettyDuration()
           
 TestState getState()
          Get the state of this test run, e.g.
 TestCase getTestCase()
           
 TestClassResult getTestClassResult()
           
 int hashCode()
          This method needs to be here in order to use proper id
 boolean isQuarantined()
          Check if the test case result was quarantined
 void 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)
           
protected  void setErrors(java.util.List<TestCaseResultError> testErrors)
           
 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.core.BambooEntityObject
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.BambooObject
setId
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 

Constructor Detail

TestCaseResultImpl

public TestCaseResultImpl()

TestCaseResultImpl

public TestCaseResultImpl(TestCase testCase,
                          long duration,
                          TestState state)

TestCaseResultImpl

public TestCaseResultImpl(TestCase testCase,
                          long duration,
                          TestState state,
                          @Nullable
                          java.util.List<TestCaseResultError> testCaseResultErrors)

TestCaseResultImpl

public TestCaseResultImpl(TestCase testCase,
                          long duration,
                          TestState state,
                          @Nullable
                          java.util.List<TestCaseResultError> testCaseResultErrors,
                          java.util.List<java.lang.String> quarantinedTests)
Method Detail

getName

@Nullable
public java.lang.String getName()
Specified by:
getName in interface TestCaseResult
Specified by:
getName in interface NameProvider
Returns:
the name of the TestCase if available

getMethodName

@Nullable
public java.lang.String getMethodName()
Specified by:
getMethodName in interface TestCaseResult
Returns:
the user friendly view of the TestCase if available.

getPrettyDuration

public java.lang.String getPrettyDuration()
Specified by:
getPrettyDuration in interface TestCaseResult
Returns:
a user friendly view of the duration.

getTestCase

public TestCase getTestCase()
Specified by:
getTestCase in interface TestCaseResult
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 interface TestCaseResult
Returns:
duration of the TestCase in milliseconds

setDuration

public void setDuration(long duration)

getTestClassResult

public TestClassResult getTestClassResult()
Specified by:
getTestClassResult in interface TestCaseResult
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 interface TestCaseResult
Parameters:
testClassResult - this test result belongs to

getErrors

@NotNull
public java.util.List<TestCaseResultError> getErrors()
Specified by:
getErrors in interface TestCaseResult
Returns:
Any errors the test generated

setErrors

protected void setErrors(@Nullable
                         java.util.List<TestCaseResultError> testErrors)

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 interface TestCaseResult
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 interface TestCaseResult
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 interface TestCaseResult
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 interface TestCaseResult
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 interface TestCaseResult
Parameters:
buildNumber - that the test has been failing since

hashCode

public int hashCode()
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
hashCode in class BambooEntityObject

equals

public boolean equals(java.lang.Object o)
Description copied from class: BambooEntityObject
This method needs to be here in order to use proper id

Overrides:
equals in class BambooEntityObject

compareTo

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

isQuarantined

public boolean isQuarantined()
Description copied from interface: TestCaseResult
Check if the test case result was quarantined

Specified by:
isQuarantined in interface TestCaseResult
Returns:
true/false quarantine status for this result

setQuarantined

public void setQuarantined(boolean quarantined)


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.