Class TestCaseHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<TestCase>
com.atlassian.bamboo.resultsummary.tests.TestCaseHibernateDao
- All Implemented Interfaces:
BambooObjectDao<TestCase>,TestCaseDao,org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongCount all TestCase recordsfindById(long testCaseId) Find a specific testCase by idReturns a list of alltest casesthat are marked as quarantined, but their quarantine has expired.getLongestRunningTestCasesForPlan(@NotNull 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)getLongestToFixTestCasesForBuildResults(@NotNull List<BuildResultsSummary> buildResults) Retrieve a list of the test cases that have taken the longest amount of time to fix.getLongestToFixTestCasesForPlan(@NotNull ImmutablePlan plan) Retrieve a list of the test cases that have taken the longest amount of time to fix.getMostFailingTestCasesForBuildResults(@NotNull List<BuildResultsSummary> buildResults) Provide a list of the top 10 most failing test cases for a plan.getMostFailingTestCasesForPlan(@NotNull ImmutablePlan plan) Provide a list of the top 10 most failing test cases for a plan.getQuarantinedTestCasesForChain(@NotNull ImmutableChain chain) Provide a list of the quarantined tests for a jobgetQuarantinedTestCasesForJob(@NotNull ImmutableJob job) Provide a list of the quarantined tests for a jobgetTopBrokenTests(@NotNull PlanKey planKey, BuildResultsFilter filter) longscrollTestCasesForExport(@NotNull Consumer<TestCase> consumer) Scroll through and execute function for each of TestCase records Objects passed to function are not fully initialized.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findAll, findById, merge, save, saveAllMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
TestCaseHibernateDao
public TestCaseHibernateDao()
-
-
Method Details
-
findById
Description copied from interface:TestCaseDaoFind a specific testCase by id- Specified by:
findByIdin interfaceTestCaseDao- Parameters:
testCaseId- of the test case you want to find- Returns:
- the testCase corresponding to the id provided.
-
getLongestRunningTestCasesForPlan
@NotNull public @NotNull List<TestCase> getLongestRunningTestCasesForPlan(@NotNull @NotNull ImmutablePlan plan) Description copied from interface:TestCaseDaoProvide 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)- Specified by:
getLongestRunningTestCasesForPlanin interfaceTestCaseDao- Parameters:
plan- to search in for the tests.- Returns:
- List of Pairs containing the testCase id (long) and the average duration (float)
-
getQuarantinedTestCasesForChain
@NotNull public @NotNull List<TestCase> getQuarantinedTestCasesForChain(@NotNull @NotNull ImmutableChain chain) Description copied from interface:TestCaseDaoProvide a list of the quarantined tests for a job- Specified by:
getQuarantinedTestCasesForChainin interfaceTestCaseDao- Parameters:
chain- to search in for the tests.- Returns:
- List of TestCases
-
countCurrentlyQuarantinedTests
- Specified by:
countCurrentlyQuarantinedTestsin interfaceTestCaseDao
-
getQuarantinedTestCasesForJob
@NotNull public @NotNull List<TestCase> getQuarantinedTestCasesForJob(@NotNull @NotNull ImmutableJob job) Description copied from interface:TestCaseDaoProvide a list of the quarantined tests for a job- Specified by:
getQuarantinedTestCasesForJobin interfaceTestCaseDao- Parameters:
job- to search in for the tests.- Returns:
- List of TestCases
-
getMostFailingTestCasesForPlan
@NotNull public @NotNull List<Pair<Long,Long>> getMostFailingTestCasesForPlan(@NotNull @NotNull ImmutablePlan plan) Description copied from interface:TestCaseDaoProvide 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.- Specified by:
getMostFailingTestCasesForPlanin interfaceTestCaseDao- 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 public @NotNull List<Pair<Long,Long>> getMostFailingTestCasesForBuildResults(@NotNull @NotNull List<BuildResultsSummary> buildResults) Description copied from interface:TestCaseDaoProvide 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.- Specified by:
getMostFailingTestCasesForBuildResultsin interfaceTestCaseDao- 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 public @NotNull List<Pair<Long,Float>> getLongestToFixTestCasesForPlan(@NotNull @NotNull ImmutablePlan plan) Description copied from interface:TestCaseDaoRetrieve 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.- Specified by:
getLongestToFixTestCasesForPlanin interfaceTestCaseDao- 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 public @NotNull List<Pair<Long,Float>> getLongestToFixTestCasesForBuildResults(@NotNull @NotNull List<BuildResultsSummary> buildResults) Description copied from interface:TestCaseDaoRetrieve 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.- Specified by:
getLongestToFixTestCasesForBuildResultsin interfaceTestCaseDao- 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)
-
getTopBrokenTests
@NotNull public @NotNull List<Pair<Long,Long>> getTopBrokenTests(@NotNull @NotNull PlanKey planKey, BuildResultsFilter filter) - Specified by:
getTopBrokenTestsin interfaceTestCaseDao
-
countTestCases
public long countTestCases()Description copied from interface:TestCaseDaoCount all TestCase records- Specified by:
countTestCasesin interfaceTestCaseDao- Returns:
- number of TestCase records
-
scrollTestCasesForExport
Description copied from interface:TestCaseDaoScroll 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.- Specified by:
scrollTestCasesForExportin interfaceTestCaseDao- Parameters:
consumer- consumer to accept each of the TestCase records- Returns:
- number of traversed rows
-
getAllTestCasesWithExpiredQuarantine
Description copied from interface:TestCaseDaoReturns a list of alltest casesthat are marked as quarantined, but their quarantine has expired.- Specified by:
getAllTestCasesWithExpiredQuarantinein interfaceTestCaseDao- Returns:
- test cases with expired quarantine
-