Class TestCaseImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.resultsummary.tests.TestCaseImpl
-
- All Implemented Interfaces:
BambooIdProvider
,BambooObject
,TestCase
,Cloneable
,Comparable<TestCase>
@Entity public class TestCaseImpl extends BambooEntityObject implements TestCase
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_LEN
-
Constructor Summary
Constructors Constructor Description TestCaseImpl()
TestCaseImpl(String name)
TestCaseImpl(String name, TestClass testClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(TestCase testCase)
@NotNull TestCase
copyTestCase()
Creates a copy of theTestCase
.boolean
equals(Object o)
long
getAverageDuration()
long
getAverageDurationInSeconds()
int
getFirstRanBuildNumber()
int
getLastRanBuildNumber()
int
getLastRecordedBuildNumber()
String
getLinkedJiraIssueKey()
Tests can be linked to a specific jira issue.String
getMethodName()
Returns a sentence describing the test, derived from the method name of the test.String
getName()
int
getNumberOfFailedRuns()
int
getNumberOfSkippedRuns()
int
getNumberOfSuccessRuns()
@Nullable QuarantineStatistics
getQuarantineStatistics()
double
getSuccessPercentage()
TestClass
getTestClass()
int
getTotalTestRuns()
int
hashCode()
boolean
isQuarantined()
void
setAverageDuration(long averageDuration)
void
setFirstRanBuildNumber(int firstRanBuildNumber)
void
setLastRanBuildNumber(int lastRanBuildNumber)
void
setLastRecordedBuildNumber(int lastRecordedBuildNumber)
void
setLinkedJiraIssueKey(@Nullable String issueKey)
protected void
setName(String name)
protected void
setNameAndTruncate(String name)
void
setNumberOfFailedRuns(int numberOfFailedRuns)
void
setNumberOfSkippedRuns(int numberOfSkippedRuns)
Set the number of runs this test has een skipped.void
setNumberOfSuccessRuns(int numberOfSuccessRuns)
void
setQuarantineStatistics(@NotNull String quarantineUser, @NotNull Date quarantineDate)
Deprecated.since 5.9void
setQuarantineStatistics(@NotNull String quarantineUser, @NotNull Date quarantineDate, @Nullable Date quarantineExpiryDate)
void
setQuarantineStatistics(@Nullable QuarantineStatistics quarantineStatistics)
void
setTestClass(TestClass testClass)
Set the testClass this test case belongs to-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, 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
-
-
-
-
Field Detail
-
MAX_LEN
public static final int MAX_LEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMethodName
public String getMethodName()
Description copied from interface:TestCase
Returns a sentence describing the test, derived from the method name of the test.- Specified by:
getMethodName
in interfaceTestCase
- Returns:
- The sentence
-
getSuccessPercentage
public double getSuccessPercentage()
- Specified by:
getSuccessPercentage
in interfaceTestCase
- Returns:
- how successful this test case has been. (success runs / total runs)
-
getTotalTestRuns
public int getTotalTestRuns()
- Specified by:
getTotalTestRuns
in interfaceTestCase
- Returns:
- the total number of times this test has run.
-
getName
public String getName()
-
setNameAndTruncate
protected void setNameAndTruncate(String name)
-
setName
protected void setName(String name)
-
getTestClass
public TestClass getTestClass()
- Specified by:
getTestClass
in interfaceTestCase
- Returns:
- the TestClass the testcase belongs to
-
setTestClass
public void setTestClass(TestClass testClass)
Description copied from interface:TestCase
Set the testClass this test case belongs to- Specified by:
setTestClass
in interfaceTestCase
- Parameters:
testClass
- the test case belongs to
-
getNumberOfSuccessRuns
public int getNumberOfSuccessRuns()
- Specified by:
getNumberOfSuccessRuns
in interfaceTestCase
- Returns:
- the number of times this test has run successfully
-
setNumberOfSuccessRuns
public void setNumberOfSuccessRuns(int numberOfSuccessRuns)
- Specified by:
setNumberOfSuccessRuns
in interfaceTestCase
-
getNumberOfFailedRuns
public int getNumberOfFailedRuns()
- Specified by:
getNumberOfFailedRuns
in interfaceTestCase
- Returns:
- the number of times this test has run and failed
-
setNumberOfFailedRuns
public void setNumberOfFailedRuns(int numberOfFailedRuns)
- Specified by:
setNumberOfFailedRuns
in interfaceTestCase
-
getNumberOfSkippedRuns
public int getNumberOfSkippedRuns()
- Specified by:
getNumberOfSkippedRuns
in interfaceTestCase
- Returns:
- the number of times this test has been skipped.
-
setNumberOfSkippedRuns
public void setNumberOfSkippedRuns(int numberOfSkippedRuns)
Description copied from interface:TestCase
Set the number of runs this test has een skipped.- Specified by:
setNumberOfSkippedRuns
in interfaceTestCase
- Parameters:
numberOfSkippedRuns
- the new number of skipped runs.
-
getAverageDuration
public long getAverageDuration()
- Specified by:
getAverageDuration
in interfaceTestCase
- Returns:
- the average duration in milliseconds of this test case for all test runs.
-
getAverageDurationInSeconds
public long getAverageDurationInSeconds()
- Specified by:
getAverageDurationInSeconds
in interfaceTestCase
- Returns:
- the average duration in seconds of this test case for all test runs.
-
setAverageDuration
public void setAverageDuration(long averageDuration)
- Specified by:
setAverageDuration
in interfaceTestCase
-
getFirstRanBuildNumber
public int getFirstRanBuildNumber()
- Specified by:
getFirstRanBuildNumber
in interfaceTestCase
- Returns:
- the build number that this test was first run in.
-
setFirstRanBuildNumber
public void setFirstRanBuildNumber(int firstRanBuildNumber)
- Specified by:
setFirstRanBuildNumber
in interfaceTestCase
-
getLastRanBuildNumber
public int getLastRanBuildNumber()
- Specified by:
getLastRanBuildNumber
in interfaceTestCase
- Returns:
- the most recent build (except for once-off builds) that this test was part of
-
setLastRanBuildNumber
public void setLastRanBuildNumber(int lastRanBuildNumber)
- Specified by:
setLastRanBuildNumber
in interfaceTestCase
-
getLastRecordedBuildNumber
public int getLastRecordedBuildNumber()
- Specified by:
getLastRecordedBuildNumber
in interfaceTestCase
- Returns:
- the most recent build (including once-off builds) that this test was part of
-
setLastRecordedBuildNumber
public void setLastRecordedBuildNumber(int lastRecordedBuildNumber)
- Specified by:
setLastRecordedBuildNumber
in interfaceTestCase
-
isQuarantined
public boolean isQuarantined()
- Specified by:
isQuarantined
in interfaceTestCase
-
setQuarantineStatistics
@Deprecated public void setQuarantineStatistics(@NotNull @NotNull String quarantineUser, @NotNull @NotNull Date quarantineDate)
Deprecated.since 5.9- Specified by:
setQuarantineStatistics
in interfaceTestCase
-
setQuarantineStatistics
public void setQuarantineStatistics(@NotNull @NotNull String quarantineUser, @NotNull @NotNull Date quarantineDate, @Nullable @Nullable Date quarantineExpiryDate)
- Specified by:
setQuarantineStatistics
in interfaceTestCase
-
setQuarantineStatistics
public void setQuarantineStatistics(@Nullable @Nullable QuarantineStatistics quarantineStatistics)
- Specified by:
setQuarantineStatistics
in interfaceTestCase
-
getQuarantineStatistics
@Nullable public @Nullable QuarantineStatistics getQuarantineStatistics()
- Specified by:
getQuarantineStatistics
in interfaceTestCase
-
getLinkedJiraIssueKey
public String getLinkedJiraIssueKey()
Description copied from interface:TestCase
Tests can be linked to a specific jira issue. This is the issue key of that issue.- Specified by:
getLinkedJiraIssueKey
in interfaceTestCase
- Returns:
-
setLinkedJiraIssueKey
public void setLinkedJiraIssueKey(@Nullable @Nullable String issueKey)
- Specified by:
setLinkedJiraIssueKey
in interfaceTestCase
-
copyTestCase
@NotNull public @NotNull TestCase copyTestCase()
Description copied from interface:TestCase
- Specified by:
copyTestCase
in interfaceTestCase
- Returns:
- copyOfTestCase
-
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(TestCase testCase)
- Specified by:
compareTo
in interfaceComparable<TestCase>
-
-