public class TestsManagerImpl extends Object implements TestsManager
Constructor and Description |
---|
TestsManagerImpl(TestCaseDao testCaseDao,
TestCaseResultDao testCaseResultDao,
TestResultsDao testResultsDao,
TestsDao testsDao,
PlanManager planManager,
ResultsSummaryManager resultsSummaryManager) |
Modifier and Type | Method and Description |
---|---|
void |
copyTestResultsToBuildResultsSummary(BuildResultsSummary summary,
BuildResults buildResults,
BuildContext buildContext)
Converts the test results sent back from the agent to a list of TestClassResults and attaches them to the BRS.
|
void |
copyTestResultsToBuildResultsSummary(Plan plan,
BuildResultsSummary summary,
List<TestResults> testResults)
Converts a set of test results to a list of TestClassResults and attaches them to the BRS.
|
List<Pair<TestCaseResult,Integer>> |
getLastNFailingResults(TestCase testCase,
int number)
Retrieve the last n failing testResults for this given test case, latest first.
|
List<Pair<TestCaseResult,Integer>> |
getLastNFailingResults(TestCase testCase,
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.
|
List<TestCase> |
getLongestRunningTestCases(ImmutablePlan 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)
|
List<Pair<TestCase,Float>> |
getLongestToFixTestCases(ImmutablePlan plan)
Retrieve a list of the test cases that have taken the longest amount of time to fix.
|
List<Pair<TestCase,Float>> |
getLongestToFixTestCases(List<BuildResultsSummary> buildResults)
Retrieve a list of the test cases that have taken the longest amount of time to fix.
|
List<Pair<TestCase,Long>> |
getMostFailingTestCases(ImmutablePlan plan)
Provide a list of the top 10 most failing test cases for a plan.
|
List<Pair<TestCase,Long>> |
getMostFailingTestCases(List<BuildResultsSummary> buildResults)
Provide a list of the top 10 most failing test cases for a plan.
|
List<TestCaseResultStatisticsProvider> |
getResultStatistics(TestCase testCase)
Returns a list of wrapped TestCaseResult and BuildResultSummary for a particular test case, for use by e.g.
|
List<TestCaseResultStatisticsProvider> |
getResultStatistics(TestCase testCase,
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.
|
TestCase |
getTestCaseById(long testCaseId)
Find a specific testCase by id
|
TestCaseResult |
getTestCaseResult(TestCase testCase,
long buildNumber)
Find a specific run of a testCase
|
TestCaseResult |
getTestCaseResultById(long testCaseId)
Find a specific testCaseResult by id
|
List<TestCaseResult> |
getTestCaseResults(TestCase testCase,
long buildNumber)
Find a specific run of a testCase
|
TestClass |
getTestClassById(long testClassId)
Find a specific testClass by id
|
TestClassResult |
getTestClassResultById(long testClassResultId)
Find a specific testClassResult by id
|
List<TestClassResult> |
getTestClassResults(PlanResultKey planResultKey)
Retrieves a list of all testClassResults for a BuildResultSummary
|
com.google.common.collect.TreeMultimap<TestClassResult,TestCaseResult> |
getTestOrderedMap(List<TestCaseResult> tests)
Generate a ListOrderedMap of TestClassResult to list of
TestCaseResult based on a given list of TestCaseResults. |
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)
|
List<TestCaseResult> |
getTestsForBuildResultByState(BuildResultsSummary summary,
TestState state)
Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS)
|
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).
|
List<TestCaseResult> |
getTestsForChainResultByDeltaState(ChainResultsSummary summary,
TestDeltaState deltaState,
int firstResult,
int maxCount)
Retrieves a list of testCaseResults for a ChainResultSummary based on their delta state (e.g BROKEN, FIXED)
|
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)
|
List<TestCaseResult> |
getTestsForChainResultByState(ChainResultsSummary summary,
TestState testState,
int firstResult,
int maxCount)
Retrieves a list of testCaseResults for a ChainResultSummary based on their
TestState |
List<Pair<TestCase,Long>> |
getTopBrokenTests(PlanKey planKey,
BuildResultsFilter filter)
Returns a pai of the top 10 tests that's broken + the count for a given filter period
|
int |
removeResultsByPlan(Plan plan)
Remove all
TestClassResult objects referenced by ResultsSummary objects identified by planKey |
int |
removeResultsByPlan(PlanKey planKey)
Remove all
TestClassResult objects referenced by ResultsSummary objects identified by planKey |
void |
repopulateTestResultsInBuildResultsSummary(Plan plan,
BuildResultsSummary summary,
List<TestResults> unorderedSuccessfulTests) |
void |
saveTestCase(TestCase testCase)
Save an individual TestCase to the database
|
void |
saveTestClass(TestClass testClass)
Save a TestClass (and included TestCases) to the database
|
protected void |
updateTestCaseResultDeltaInformation(BuildResultsSummary summary,
TestCaseResult testResult,
Map<TestCase,TestCaseResult> previousFailuresAndSkipped) |
public TestsManagerImpl(TestCaseDao testCaseDao, TestCaseResultDao testCaseResultDao, TestResultsDao testResultsDao, TestsDao testsDao, PlanManager planManager, ResultsSummaryManager resultsSummaryManager)
public void saveTestClass(TestClass testClass)
TestsManager
saveTestClass
in interface TestsManager
testClass
- to savepublic void saveTestCase(TestCase testCase)
TestsManager
saveTestCase
in interface TestsManager
testCase
- to savepublic TestCaseResult getTestCaseResultById(long testCaseId)
TestsManager
getTestCaseResultById
in interface TestsManager
testCaseId
- of the test you want to findpublic TestClassResult getTestClassResultById(long testClassResultId)
TestsManager
getTestClassResultById
in interface TestsManager
testClassResultId
- of the test you want to find@Nullable public TestClass getTestClassById(long testClassId)
TestsManager
getTestClassById
in interface TestsManager
testClassId
- of the test class you want to find@Nullable public TestCase getTestCaseById(long testCaseId)
TestsManager
getTestCaseById
in interface TestsManager
testCaseId
- of the test case you want to find@NotNull public List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary summary, TestState state)
TestsManager
getTestsForBuildResultByState
in interface TestsManager
summary
- the BuildResultsSummary to get the tests forstate
- - The TestState to search for.@NotNull public List<TestCaseResult> getTestsForBuildResultByState(BuildResultsSummary summary, TestState state, int firstResult, int maxCount)
TestsManager
getTestsForBuildResultByState
in interface TestsManager
summary
- the BuildResultsSummary to get the tests forstate
- - The TestState to search for.firstResult
- - index of the first resultmaxCount
- - maximum amount of records returned@NotNull public List<TestCaseResult> getTestsForBuildResultByDeltaState(BuildResultsSummary summary, TestDeltaState deltaState, int firstResult, int maxCount)
TestsManager
getTestsForBuildResultByDeltaState
in interface TestsManager
summary
- the BuildResultsSummary to get the tests fordeltaState
- - The TestDeltaState to search for.firstResult
- - index of the first resultmaxCount
- - maximum amount of records returnedpublic List<TestCaseResult> getTestsForChainResultByDeltaState(ChainResultsSummary summary, TestDeltaState deltaState, int firstResult, int maxCount)
TestsManager
getTestsForChainResultByDeltaState
in interface TestsManager
firstResult
- - index of the first resultmaxCount
- - maximum amount of records returned@NotNull public List<TestCaseResult> getTestsForChainResultByDeltaStates(@NotNull ChainResultsSummary summary, @NotNull TestDeltaState[] deltaStates, int firstResult, int maxCount)
TestsManager
getTestsForChainResultByDeltaStates
in interface TestsManager
firstResult
- - index of the first resultmaxCount
- - maximum amount of records returned@NotNull public List<TestCaseResult> getTestsForChainResultByState(@NotNull ChainResultsSummary summary, @NotNull TestState testState, int firstResult, int maxCount)
TestsManager
TestState
getTestsForChainResultByState
in interface TestsManager
@NotNull public List<TestCaseResultStatisticsProvider> getResultStatistics(@NotNull TestCase testCase)
TestsManager
getResultStatistics
in interface TestsManager
testCase
- to find the results forTestCaseResultStatisticsProvider
for each TestCaseResult found for the TestCase@NotNull public List<TestCaseResultStatisticsProvider> getResultStatistics(@NotNull TestCase testCase, @NotNull List<BuildResultsSummary> buildResults)
TestsManager
getResultStatistics
in interface TestsManager
testCase
- to find the results forbuildResults
- to contain search to (this list must not be empty)TestCaseResultStatisticsProvider
for each TestCaseResult found for the TestCase@NotNull public List<Pair<TestCaseResult,Integer>> getLastNFailingResults(@NotNull TestCase testCase, int number)
TestsManager
getLastNFailingResults
in interface TestsManager
testCase
- to look for the results for.number
- of results to retrieve@NotNull public List<Pair<TestCaseResult,Integer>> getLastNFailingResults(@NotNull TestCase testCase, @NotNull List<BuildResultsSummary> buildResults, int number)
TestsManager
getLastNFailingResults
in interface TestsManager
testCase
- to look for the results for.buildResults
- to search in for the tests.number
- of results to retrieve@NotNull public List<TestCase> getLongestRunningTestCases(@NotNull ImmutablePlan plan)
TestsManager
getLongestRunningTestCases
in interface TestsManager
plan
- to search in for the tests.@NotNull public List<Pair<TestCase,Long>> getMostFailingTestCases(@NotNull ImmutablePlan plan)
TestsManager
getMostFailingTestCases
in interface TestsManager
plan
- to search for the tests@NotNull public List<Pair<TestCase,Long>> getMostFailingTestCases(@NotNull List<BuildResultsSummary> buildResults)
TestsManager
getMostFailingTestCases
in interface TestsManager
buildResults
- to search in for the tests.@NotNull public List<Pair<TestCase,Float>> getLongestToFixTestCases(@NotNull ImmutablePlan plan)
TestsManager
getLongestToFixTestCases
in interface TestsManager
plan
- to search for results inpublic List<Pair<TestCase,Long>> getTopBrokenTests(@NotNull PlanKey planKey, BuildResultsFilter filter)
TestsManager
getTopBrokenTests
in interface TestsManager
@NotNull public List<Pair<TestCase,Float>> getLongestToFixTestCases(@NotNull List<BuildResultsSummary> buildResults)
TestsManager
getLongestToFixTestCases
in interface TestsManager
buildResults
- to search in for the tests.@Nullable public TestCaseResult getTestCaseResult(TestCase testCase, long buildNumber)
TestsManager
getTestCaseResult
in interface TestsManager
testCase
- to look forbuildNumber
- of the build the run should have occured in@NotNull public List<TestCaseResult> getTestCaseResults(TestCase testCase, long buildNumber)
TestsManager
getTestCaseResults
in interface TestsManager
testCase
- to look forbuildNumber
- of the build the run should have occured in@Nullable public BuildResultsSummary getSucceedingSinceBuildResultSummary(TestCase testCase)
TestsManager
getSucceedingSinceBuildResultSummary
in interface TestsManager
testCase
- to search history for.public int removeResultsByPlan(@NotNull Plan plan)
TestsManager
TestClassResult
objects referenced by ResultsSummary
objects identified by planKeyremoveResultsByPlan
in interface TestsManager
plan
- planpublic int removeResultsByPlan(@NotNull PlanKey planKey)
TestsManager
TestClassResult
objects referenced by ResultsSummary
objects identified by planKeyremoveResultsByPlan
in interface TestsManager
planKey
- planKey@NotNull public com.google.common.collect.TreeMultimap<TestClassResult,TestCaseResult> getTestOrderedMap(@NotNull List<TestCaseResult> tests)
TestsManager
TestCaseResult
based on a given list of TestCaseResults.getTestOrderedMap
in interface TestsManager
tests
- to put in the mapTestCaseResult
public void copyTestResultsToBuildResultsSummary(@NotNull BuildResultsSummary summary, @NotNull BuildResults buildResults, @NotNull BuildContext buildContext)
TestsManager
copyTestResultsToBuildResultsSummary
in interface TestsManager
summary
- for the interesting tests to be attached to.buildResults
- for the boring tests to be attached tobuildContext
- for the build that has the tests we want to move@NotNull public List<TestClassResult> getTestClassResults(@NotNull PlanResultKey planResultKey)
TestsManager
getTestClassResults
in interface TestsManager
planResultKey
- key of the BuildResultsSummary to get the tests class results forpublic void copyTestResultsToBuildResultsSummary(@NotNull Plan plan, @NotNull BuildResultsSummary summary, @NotNull List<TestResults> testResults)
TestsManager
copyTestResultsToBuildResultsSummary
in interface TestsManager
plan
- the tests are run againstsummary
- for the tests to be attached to.testResults
- the set of tests to convert.public void repopulateTestResultsInBuildResultsSummary(@NotNull Plan plan, @NotNull BuildResultsSummary summary, @NotNull List<TestResults> unorderedSuccessfulTests)
repopulateTestResultsInBuildResultsSummary
in interface TestsManager
protected void updateTestCaseResultDeltaInformation(@NotNull BuildResultsSummary summary, @NotNull TestCaseResult testResult, @NotNull Map<TestCase,TestCaseResult> previousFailuresAndSkipped)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.