com.atlassian.bamboo.resultsummary.tests
Interface TestResultsDao

All Superinterfaces:
BambooObjectDao, bucket.core.persistence.ObjectDao
All Known Implementing Classes:
TestResultsHibernateDao

public interface TestResultsDao
extends BambooObjectDao

Dao for retrieving and manipulating Test Results (e.g TestClassResult, TestCaseResult)


Method Summary
 long countTestCaseResultErrors()
          Count all TestCaseResultErrors
 long countTestCaseResults()
          Count all TestCaseResults
 long countTestClassResults()
          Count all TestClassResults
 long countTestClassResults(PlanKey planKey)
          Count TestClassResults for a Plan
 java.util.List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCase(TestCase testCase)
          Returns a list of wrapped TestCaseResult and BuildResultSummary for a particular test case, for use by e.g.
 java.util.List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCaseAndBuilds(TestCase testCase, java.util.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.
 BuildResultsSummary getSucceedingSinceBuildResultSummary(TestCase testCase)
          Find the build in which the given test has been successful since.
 TestCaseResult getTestCaseResult(TestCase testCase, long buildNumber)
          Find a specific run of a testCase
 TestCaseResult getTestCaseResultById(long testCaseResultId)
          Find a specific testCaseResult by id
 java.util.List<TestCaseResult> getTestCaseResultsForTestCase(TestCase testCase)
          Return a list of TestCaseResults for a given TestCase
 java.util.List<TestCaseResult> getTestCaseResultsForTestCaseAndBuilds(TestCase testCase, java.util.List<BuildResultsSummary> buildResults)
          Return a list of TestCaseResults for a given TestCase constrained to a specific set of Build Result Summaries
 TestClassResult getTestClassResultById(long testClassResultId)
          Find a specific testClassResult by id
 java.util.List<TestClassResult> getTestClassResults(PlanResultKey planResultKey)
          Retrieves a list of all testClassResults for a BuildResultSummary
 java.util.List<TestCaseResult> getTestsForBuildResultByDeltaState(BuildResultsSummary summary, TestDeltaState deltaState, int firstResult, int maxCount)
          Retrieves a list of testCaseResults for a BuildResultSummary based on their delta state (e.g BROKEN, FIXED)
 java.util.List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary summary, TestState state)
          Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS)
 java.util.List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary summary, TestState state, int firstResult, int maxCount)
          Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS).
 java.util.List<TestCaseResult> getTestsForBuildResultSummary(BuildResultsSummary summary)
          Retrieves a list of all testCaseResults for a BuildResultSummary
 long scrollTestCaseResultErrorsForExport(com.google.common.base.Function<TestCaseResultError,java.lang.Void> function)
          Scroll through and execute function for each of TestCaseResultErrors Objects passed to function are not fully initialized.
 long scrollTestCaseResultsForExport(com.google.common.base.Function<TestCaseResult,java.lang.Void> function)
          Scroll through and execute function for each of TestCaseResults Objects passed to function are not fully initialized.
 long scrollTestClassResultsForExport(com.google.common.base.Function<TestClassResult,java.lang.Void> function)
          Scroll through and execute function for each of TestClassResults Objects passed to function are not fully initialized.
 
Methods inherited from interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
 

Method Detail

getTestsForBuildResultByState

@NotNull
java.util.List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary summary,
                                                                     TestState state)
Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS)

Parameters:
summary - the BuildResultsSaummary to get the tests for
state - - The TestState to search for.
Returns:
a list of testCaseResults for a BuildResultSummary with the given state

getTestsForBuildResultByState

@NotNull
java.util.List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary 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
java.util.List<TestCaseResult> getTestsForBuildResultByDeltaState(BuildResultsSummary 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

countTestClassResults

long countTestClassResults()
Count all TestClassResults

Returns:
number of TestClassResults

countTestCaseResults

long countTestCaseResults()
Count all TestCaseResults

Returns:
number of TestCaseResults

countTestCaseResultErrors

long countTestCaseResultErrors()
Count all TestCaseResultErrors

Returns:
number of TestCaseResultErrors

countTestClassResults

long countTestClassResults(@NotNull
                           PlanKey planKey)
Count TestClassResults for a Plan

Parameters:
planKey - the Plan to count TestClassResults for
Returns:
number of TestClassResults

scrollTestClassResultsForExport

long scrollTestClassResultsForExport(@NotNull
                                     com.google.common.base.Function<TestClassResult,java.lang.Void> function)
Scroll through and execute function for each of TestClassResults Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.

Parameters:
function - function to be executed on each of the TestClassResults
Returns:
number of traversed rows

scrollTestCaseResultsForExport

long scrollTestCaseResultsForExport(@NotNull
                                    com.google.common.base.Function<TestCaseResult,java.lang.Void> function)
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:
function - function to be executed on each of the TestClassResults
Returns:
number of traversed rows

scrollTestCaseResultErrorsForExport

long scrollTestCaseResultErrorsForExport(@NotNull
                                         com.google.common.base.Function<TestCaseResultError,java.lang.Void> function)
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:
function - function to be executed on each of the TestClassResults
Returns:
number of traversed rows

getTestClassResults

@NotNull
java.util.List<TestClassResult> getTestClassResults(@NotNull
                                                            PlanResultKey planResultKey)
Retrieves a list of all testClassResults for a BuildResultSummary

Parameters:
planResultKey - key of the BuildResultsSummary to get the tests class results for
Returns:
a list of all testClassResults for the BuildResultSummary

getTestsForBuildResultSummary

@NotNull
java.util.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

getTestCaseResultById

TestCaseResult getTestCaseResultById(long testCaseResultId)
Find a specific testCaseResult by id

Parameters:
testCaseResultId - of the test you want to find
Returns:
the testCaseResult corresponding to the id provided.

getTestClassResultById

TestClassResult getTestClassResultById(long testClassResultId)
Find a specific testClassResult by id

Parameters:
testClassResultId - of the test you want to find
Returns:
the testClassResult corresponding to the id provided.

getResultStatisticsForTestCase

@NotNull
java.util.List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCase(@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 for each TestCaseResult found for the TestCase

getResultStatisticsForTestCaseAndBuilds

@NotNull
java.util.List<TestCaseResultStatisticsProvider> getResultStatisticsForTestCaseAndBuilds(@NotNull
                                                                                                 TestCase testCase,
                                                                                                 @NotNull
                                                                                                 java.util.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 for each TestCaseResult found for the TestCase

getTestCaseResultsForTestCase

@NotNull
java.util.List<TestCaseResult> getTestCaseResultsForTestCase(@NotNull
                                                                     TestCase testCase)
Return a list of TestCaseResults for a given TestCase

Parameters:
testCase - to look for
Returns:
List for the given TestCase

getTestCaseResultsForTestCaseAndBuilds

@NotNull
java.util.List<TestCaseResult> getTestCaseResultsForTestCaseAndBuilds(@NotNull
                                                                              TestCase testCase,
                                                                              @NotNull
                                                                              java.util.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 for the given TestCase

getTestCaseResult

@Nullable
TestCaseResult getTestCaseResult(TestCase testCase,
                                          long buildNumber)
Find a specific run of a testCase

Parameters:
testCase - to look for
buildNumber - of the build the run should have occured in
Returns:
the TestCaseResult for the given test case, if it ran in the given build.

getSucceedingSinceBuildResultSummary

@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.


Copyright © 2010 Atlassian. All Rights Reserved.