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 Details

  • Constructor Details

    • TestCaseImpl

      public TestCaseImpl()
    • TestCaseImpl

      public TestCaseImpl(String name)
    • TestCaseImpl

      public TestCaseImpl(String name, TestClass testClass)
  • Method Details

    • 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 interface TestCase
      Returns:
      The sentence
    • getSuccessPercentage

      public double getSuccessPercentage()
      Specified by:
      getSuccessPercentage in interface TestCase
      Returns:
      how successful this test case has been. (success runs / total runs)
    • getTotalTestRuns

      public int getTotalTestRuns()
      Specified by:
      getTotalTestRuns in interface TestCase
      Returns:
      the total number of times this test has run.
    • getName

      public String getName()
      Specified by:
      getName in interface TestCase
      Returns:
      The true name of the test case
    • setNameAndTruncate

      protected void setNameAndTruncate(String name)
    • setName

      protected void setName(String name)
    • getTestClass

      public TestClass getTestClass()
      Specified by:
      getTestClass in interface TestCase
      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 interface TestCase
      Parameters:
      testClass - the test case belongs to
    • getNumberOfSuccessRuns

      public int getNumberOfSuccessRuns()
      Specified by:
      getNumberOfSuccessRuns in interface TestCase
      Returns:
      the number of times this test has run successfully
    • setNumberOfSuccessRuns

      public void setNumberOfSuccessRuns(int numberOfSuccessRuns)
      Specified by:
      setNumberOfSuccessRuns in interface TestCase
    • getNumberOfFailedRuns

      public int getNumberOfFailedRuns()
      Specified by:
      getNumberOfFailedRuns in interface TestCase
      Returns:
      the number of times this test has run and failed
    • setNumberOfFailedRuns

      public void setNumberOfFailedRuns(int numberOfFailedRuns)
      Specified by:
      setNumberOfFailedRuns in interface TestCase
    • getNumberOfSkippedRuns

      public int getNumberOfSkippedRuns()
      Specified by:
      getNumberOfSkippedRuns in interface TestCase
      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 interface TestCase
      Parameters:
      numberOfSkippedRuns - the new number of skipped runs.
    • getAverageDuration

      public long getAverageDuration()
      Specified by:
      getAverageDuration in interface TestCase
      Returns:
      the average duration in milliseconds of this test case for all test runs.
    • getAverageDurationInSeconds

      public long getAverageDurationInSeconds()
      Specified by:
      getAverageDurationInSeconds in interface TestCase
      Returns:
      the average duration in seconds of this test case for all test runs.
    • setAverageDuration

      public void setAverageDuration(long averageDuration)
      Specified by:
      setAverageDuration in interface TestCase
    • getFirstRanBuildNumber

      public int getFirstRanBuildNumber()
      Specified by:
      getFirstRanBuildNumber in interface TestCase
      Returns:
      the build number that this test was first run in.
    • setFirstRanBuildNumber

      public void setFirstRanBuildNumber(int firstRanBuildNumber)
      Specified by:
      setFirstRanBuildNumber in interface TestCase
    • getLastRanBuildNumber

      public int getLastRanBuildNumber()
      Specified by:
      getLastRanBuildNumber in interface TestCase
      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 interface TestCase
    • getLastRecordedBuildNumber

      public int getLastRecordedBuildNumber()
      Specified by:
      getLastRecordedBuildNumber in interface TestCase
      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 interface TestCase
    • isQuarantined

      public boolean isQuarantined()
      Specified by:
      isQuarantined in interface TestCase
    • setQuarantineStatistics

      @Deprecated public void setQuarantineStatistics(@NotNull @NotNull String quarantineUser, @NotNull @NotNull Date quarantineDate)
      Deprecated.
      since 5.9
      Specified by:
      setQuarantineStatistics in interface TestCase
    • setQuarantineStatistics

      public void setQuarantineStatistics(@NotNull @NotNull String quarantineUser, @NotNull @NotNull Date quarantineDate, @Nullable @Nullable Date quarantineExpiryDate)
      Specified by:
      setQuarantineStatistics in interface TestCase
    • setQuarantineStatistics

      public void setQuarantineStatistics(@Nullable @Nullable QuarantineStatistics quarantineStatistics)
      Specified by:
      setQuarantineStatistics in interface TestCase
    • getQuarantineStatistics

      @Nullable public @Nullable QuarantineStatistics getQuarantineStatistics()
      Specified by:
      getQuarantineStatistics in interface TestCase
    • 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 interface TestCase
      Returns:
    • setLinkedJiraIssueKey

      public void setLinkedJiraIssueKey(@Nullable @Nullable String issueKey)
      Specified by:
      setLinkedJiraIssueKey in interface TestCase
    • copyTestCase

      @NotNull public @NotNull TestCase copyTestCase()
      Description copied from interface: TestCase
      Creates a copy of the TestCase. Note that it does not include TestClass
      Specified by:
      copyTestCase in interface TestCase
      Returns:
      copyOfTestCase
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.atlassian.core.bean.EntityObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.atlassian.core.bean.EntityObject
    • compareTo

      public int compareTo(TestCase testCase)
      Specified by:
      compareTo in interface Comparable<TestCase>