com.atlassian.bamboo.resultsummary.tests
Interface TestsDao

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

public interface TestsDao
extends BambooObjectDao

Dao for retrieving and manipulating Test Objects (e.g TestClass, TestCase)


Method Summary
 long countTestCases()
          Count all TestCase records
 long countTestClasses()
          Count all TestClass records
 java.util.List<Pair<TestCaseResult,java.lang.Integer>> getLastNFailingResultsForTestCase(TestCase testCase, int number)
          Retrieve the last n failing testResults for this given test case, latest first.
 java.util.List<Pair<TestCaseResult,java.lang.Integer>> getLastNFailingResultsForTestCaseAndBuildResults(TestCase testCase, java.util.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.
 java.util.List<TestCase> getLongestRunningTestCasesForPlan(Plan plan)
          Provide a list of the top ten longest running tests for a plan, based on the duration of the TestCase's TestCaseResults Finds top 10 results in order (longest first)
 java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForBuildResults(java.util.List<BuildResultsSummary> buildResults)
          Retrieve a list of the test cases that have taken the longest amount of time to fix.
 java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForPlan(Plan plan)
          Retrieve a list of the test cases that have taken the longest amount of time to fix.
 java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForBuildResults(java.util.List<BuildResultsSummary> buildResults)
          Provide a list of the top 10 most failing test cases for a plan.
 java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForPlan(Plan plan)
          Provide a list of the top 10 most failing test cases for a plan.
 TestCase getTestCaseById(long testCaseId)
          Find a specific testCase by id
 TestClass getTestClassById(long testClassId)
          Find a specific testClass by id
 java.util.List<TestClass> getTestClassesForPlan(Plan plan)
          Retrieve all test classes attached to a specific plan
 long scrollTestCasesForExport(com.google.common.base.Function<TestCase,java.lang.Void> function)
          Scroll through and execute function for each of TestCase records Objects passed to function are not fully initialized.
 long scrollTestClassesForExport(com.google.common.base.Function<TestClass,java.lang.Void> function)
          Scroll through and execute function for each of TestClass records 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

getTestCaseById

@Nullable
TestCase getTestCaseById(long testCaseId)
Find a specific testCase by id

Parameters:
testCaseId - of the test case you want to find
Returns:
the testCase corresponding to the id provided.

getTestClassById

@Nullable
TestClass getTestClassById(long testClassId)
Find a specific testClass by id

Parameters:
testClassId - of the test class you want to find
Returns:
the testClass corresponding to the id provided.

getTestClassesForPlan

@NotNull
java.util.List<TestClass> getTestClassesForPlan(Plan plan)
Retrieve all test classes attached to a specific plan

Parameters:
plan - the tests are attached to
Returns:
a list of TestClass attached to a plan.

getLongestRunningTestCasesForPlan

@NotNull
java.util.List<TestCase> getLongestRunningTestCasesForPlan(@NotNull
                                                                   Plan plan)
Provide a list of the top ten longest running tests for a plan, based on the duration of the TestCase's TestCaseResults Finds top 10 results in order (longest first)

Parameters:
plan - to search in for the tests.
Returns:
List of Pairs containing the testCase id (long) and the average duration (float)

getMostFailingTestCasesForPlan

@NotNull
java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForPlan(@NotNull
                                                                                              Plan plan)
Provide a list of the top 10 most failing test cases for a plan. It is calculated based on failure count, not percentage. Results are ordered from most failing to least failing.

Parameters:
plan - to search for the tests
Returns:
List of Pairs containing the testCase id (long) and the number of failures found (int)

getMostFailingTestCasesForBuildResults

@NotNull
java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForBuildResults(@NotNull
                                                                                                      java.util.List<BuildResultsSummary> buildResults)
Provide a list of the top 10 most failing test cases for a plan. It is calculated based on failure count, not percentage Results are ordered from most failing to least failing.

Parameters:
buildResults - to search in for the tests.
Returns:
List of Pairs containing the testCase id (long) and the number of failures found (int)

getLongestToFixTestCasesForPlan

@NotNull
java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForPlan(@NotNull
                                                                                             Plan plan)
Retrieve a list of the test cases that have taken the longest amount of time to fix. Returns top 10 with the longest to fix first.

Parameters:
plan - to search for results in
Returns:
List of Pairs containing the testCase id (long) and the average number of builds between breakages and its corresponding fix (float)

getLongestToFixTestCasesForBuildResults

@NotNull
java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForBuildResults(@NotNull
                                                                                                     java.util.List<BuildResultsSummary> buildResults)
Retrieve a list of the test cases that have taken the longest amount of time to fix. Returns top 10 with the longest to fix first.

Parameters:
buildResults - to search in for the tests.
Returns:
List of Pairs containing the testCase id (long) and the average number of builds between breakages and its corresponding fix (float)

getLastNFailingResultsForTestCase

@NotNull
java.util.List<Pair<TestCaseResult,java.lang.Integer>> getLastNFailingResultsForTestCase(@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
java.util.List<Pair<TestCaseResult,java.lang.Integer>> getLastNFailingResultsForTestCaseAndBuildResults(@NotNull
                                                                                                                TestCase testCase,
                                                                                                                @NotNull
                                                                                                                java.util.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.

countTestClasses

long countTestClasses()
Count all TestClass records

Returns:
number of TestClass records

scrollTestClassesForExport

long scrollTestClassesForExport(@NotNull
                                com.google.common.base.Function<TestClass,java.lang.Void> function)
Scroll through and execute function for each of TestClass records 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 TestClass records
Returns:
number of traversed rows

countTestCases

long countTestCases()
Count all TestCase records

Returns:
number of TestCase records

scrollTestCasesForExport

long scrollTestCasesForExport(@NotNull
                              com.google.common.base.Function<TestCase,java.lang.Void> function)
Scroll through and execute function for each of TestCase records 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 TestCase records
Returns:
number of traversed rows


Copyright © 2010 Atlassian. All Rights Reserved.