Interface TestCaseResultDao

All Superinterfaces:
BambooObjectDao<TestCaseResult>
All Known Implementing Classes:
TestCaseResultHibernateDao

public interface TestCaseResultDao extends BambooObjectDao<TestCaseResult>
  • Method Details

    • findById

      TestCaseResult findById(long id)
      Find a specific testCaseResult by id
      Parameters:
      id - of the test you want to find
      Returns:
      the testCaseResult corresponding to the id provided.
    • getTestsForBuildResultByState

      @NotNull @NotNull List<TestCaseResult> getTestsForBuildResultByState(ResultsSummary summary, TestState state, int firstResult, int maxCount)
      Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS). To be used whenever pagination is required.
      Parameters:
      summary - the BuildResultsSummary to get the tests for
      state - the TestState to search for.
      firstResult - the first record to be retrieved. Negative values are treated as 0.
      maxCount - maximum amount of records to be retrieved. Values less than or equal to 0 are ignored.
      Returns:
      a list of testCaseResults for a BuildResultSummary with the given state
    • getTestsForBuildResultByDeltaState

      @NotNull @NotNull List<TestCaseResult> getTestsForBuildResultByDeltaState(ResultsSummary summary, TestDeltaState deltaState, int firstResult, int maxCount)
      Retrieves a list of testCaseResults for a BuildResultSummary based on their delta state (e.g BROKEN, FIXED)
      Parameters:
      summary - the BuildResultsSummary to get the tests for
      deltaState - the TestDeltaState to search for.
      firstResult - the first record to be retrieved. Negative values are treated as 0.
      maxCount - maximum amount of records to be retrieved. Values less than or equal to 0 are ignored.
      Returns:
      a list of testCaseResults for a BuildResultSummary with the given delta state
    • getTestsForChainResultByDeltaStates

      @NotNull @NotNull List<TestCaseResult> getTestsForChainResultByDeltaStates(ChainResultsSummary summary, TestDeltaState[] deltaStates, int firstResult, int maxCount)
      Retrieves a list of testCaseResults for a ChainResultSummary based on their delta state (e.g BROKEN, FIXED)
      Parameters:
      summary -
      deltaStates -
      firstResult - - index of the first result
      maxCount - - maximum amount of records returned
      Returns:
      testCaseResults
    • getTestsForChainResultByState

      @NotNull @NotNull List<TestCaseResult> getTestsForChainResultByState(@NotNull @NotNull ChainResultsSummary summary, @NotNull @NotNull TestState testState, int firstResult, int maxCount)
      Retrieves a list of testCaseResults for a ChainResultSummary based on their TestState
      Parameters:
      summary -
      testState -
      firstResult -
      maxCount -
      Returns:
      testCaseResults
    • getQuarantinedTestCasesForChainResult

      @NotNull @NotNull List<TestCaseResult> getQuarantinedTestCasesForChainResult(@NotNull @NotNull ChainResultsSummary chainResultsSummary)
      Provide a list of the quarantined tests for a chain result
      Parameters:
      chainResultsSummary - to search for the tests.
      Returns:
      List of TestCases
    • getTestsForBuildResultSummary

      @NotNull @NotNull List<TestCaseResult> getTestsForBuildResultSummary(BuildResultsSummary summary)
      Retrieves a list of all testCaseResults for a BuildResultSummary
      Parameters:
      summary - the BuildResultsSummary to get the tests for
      Returns:
      a list of all testCaseResults for the BuildResultSummary
    • getQuarantinedTestCasesForBuildResult

      @NotNull @NotNull List<TestCaseResult> getQuarantinedTestCasesForBuildResult(@NotNull @NotNull BuildResultsSummary buildResultsSummary)
      Provide a list of the quarantined tests for a build result
      Parameters:
      buildResultsSummary - to search for the tests.
      Returns:
      List of TestCases
    • getResultStatisticsForTestCase

      @NotNull @NotNull List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCase(@NotNull @NotNull TestCase testCase)
      Returns a list of wrapped TestCaseResult and BuildResultSummary for a particular test case, for use by e.g. graphs
      Parameters:
      testCase - to find the results for
      Returns:
      list of $TestCaseResultStatisticsProviderfor each TestCaseResult found for the TestCase
    • getResultStatisticsForTestCaseAndBuilds

      @NotNull @NotNull List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCaseAndBuilds(@NotNull @NotNull TestCase testCase, @NotNull @NotNull List<BuildResultsSummary> buildResults)
      Returns a list of wrapped TestCaseResult and BuildResultSummary for a particular test case and contained within a specific span of build result summaries. For use by e.g. graphs
      Parameters:
      testCase - to find the results for
      buildResults - to contain search to (this list must not be empty)
      Returns:
      list of $TestCaseResultStatisticsProvider for each TestCaseResult found for the TestCase
    • getTestCaseResultsForTestCase

      @NotNull @NotNull List<TestCaseResult> getTestCaseResultsForTestCase(@NotNull @NotNull TestCase testCase)
      Return a list of TestCaseResults for a given TestCase
      Parameters:
      testCase - to look for
      Returns:
      list of TestCaseResult for the given TestCase
    • getTestCaseResultsForTestCaseAndBuilds

      @NotNull @NotNull List<TestCaseResult> getTestCaseResultsForTestCaseAndBuilds(@NotNull @NotNull TestCase testCase, @NotNull @NotNull List<BuildResultsSummary> buildResults)
      Return a list of TestCaseResults for a given TestCase constrained to a specific set of Build Result Summaries
      Parameters:
      testCase - to look for
      buildResults - to contain search to
      Returns:
      list of TestCaseResult for the given TestCase
    • getLastNFailingResultsForTestCase

      @NotNull @NotNull List<Pair<TestCaseResult,Integer>> getLastNFailingResultsForTestCase(@NotNull @NotNull TestCase testCase, int number)
      Retrieve the last n failing testResults for this given test case, latest first.
      Parameters:
      testCase - to look for the results for.
      number - of results to retrieve
      Returns:
      List of pairs containing the offending TestCaseResult and the build number it occurred in.
    • getLastNFailingResultsForTestCaseAndBuildResults

      @NotNull @NotNull List<Pair<TestCaseResult,Integer>> getLastNFailingResultsForTestCaseAndBuildResults(@NotNull @NotNull TestCase testCase, @NotNull @NotNull List<BuildResultsSummary> buildResults, int number)
      Retrieve the last n failing testResults for this given test case, but only those that occurred within the provided build results. Latest first.
      Parameters:
      testCase - to look for the results for.
      buildResults - to search in for the tests.
      number - of results to retrieve
      Returns:
      List of pairs containing the offending TestCaseResult and the build number it occurred in.
    • getTestCaseResults

      @NotNull @NotNull List<TestCaseResult> getTestCaseResults(TestCase testCase, long buildNumber)
      Find a specific run of a testCase
      Parameters:
      testCase - to look for
      buildNumber - of the build the run should have occurred in
      Returns:
      the TestCaseResult for the given test case, if it ran in the given build.
    • getSucceedingSinceBuildResultSummary

      @Nullable @Nullable BuildResultsSummary getSucceedingSinceBuildResultSummary(TestCase testCase)
      Find the build in which the given test has been successful since. AKA the last recored "FIXED" test run. Will return null if the test has never failed (ie being successful since the beginning)
      Parameters:
      testCase - to search history for.
      Returns:
      the BuildResultSummary that this test has been successful since.
    • countTestCaseResults

      long countTestCaseResults()
      Count all TestCaseResults
      Returns:
      number of TestCaseResults
    • countTestCaseResultErrors

      long countTestCaseResultErrors()
      Count all TestCaseResultErrors
      Returns:
      number of TestCaseResultErrors
    • scrollTestCaseResultsForExport

      long scrollTestCaseResultsForExport(@NotNull @NotNull Consumer<TestCaseResult> consumer)
      Scroll through and execute function for each of TestCaseResults Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
      Parameters:
      consumer - consumer to accept each of the TestClassResults
      Returns:
      number of traversed rows
    • scrollTestCaseResultErrorsForExport

      long scrollTestCaseResultErrorsForExport(@NotNull @NotNull Consumer<TestCaseResultError> consumer)
      Scroll through and execute function for each of TestCaseResultErrors Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
      Parameters:
      consumer - consumer to accept each of the TestCaseResultErrors
      Returns:
      number of traversed rows