com.atlassian.bamboo.resultsummary.tests
Class TestCaseHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
              extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<TestCase>
                  extended by com.atlassian.bamboo.resultsummary.tests.TestCaseHibernateDao
All Implemented Interfaces:
BambooObjectDao<TestCase>, TestCaseDao, org.springframework.beans.factory.InitializingBean

public class TestCaseHibernateDao
extends BambooHibernateObjectDao<TestCase>
implements TestCaseDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
TestCaseHibernateDao()
           
 
Method Summary
 int countCurrentlyQuarantinedTests(ImmutableChain chain)
           
 long countTestCases()
          Count all TestCase records
 TestCase findById(long testCaseId)
          Find a specific testCase by id
 java.util.List<TestCase> getLongestRunningTestCasesForPlan(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)
 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(PlanIdentifier 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(PlanIdentifier plan)
          Provide a list of the top 10 most failing test cases for a plan.
 java.util.List<TestCase> getQuarantinedTestCasesForChain(ImmutableChain chain)
          Provide a list of the quarantined tests for a job
 java.util.List<TestCase> getQuarantinedTestCasesForJob(ImmutableJob job)
          Provide a list of the quarantined tests for a job
 java.util.List<Pair<java.lang.Long,java.lang.Integer>> getTopBrokenTests(PlanKey planKey, BuildResultsFilter filter)
           
 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.
 
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
delete, deleteAll, execute, executeCountQuery, executeFind, executeReturnLong, findAll, findById, save, saveAll
 
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
delete, deleteAll, executeReturnLong, findAll, findById, save, saveAll
 

Constructor Detail

TestCaseHibernateDao

public TestCaseHibernateDao()
Method Detail

findById

public TestCase findById(long testCaseId)
Description copied from interface: TestCaseDao
Find a specific testCase by id

Specified by:
findById in interface TestCaseDao
Parameters:
testCaseId - of the test case you want to find
Returns:
the testCase corresponding to the id provided.

getLongestRunningTestCasesForPlan

@NotNull
public java.util.List<TestCase> getLongestRunningTestCasesForPlan(@NotNull
                                                                          ImmutablePlan plan)
Description copied from interface: TestCaseDao
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)

Specified by:
getLongestRunningTestCasesForPlan in interface TestCaseDao
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 java.util.List<TestCase> getQuarantinedTestCasesForChain(@NotNull
                                                                        ImmutableChain chain)
Description copied from interface: TestCaseDao
Provide a list of the quarantined tests for a job

Specified by:
getQuarantinedTestCasesForChain in interface TestCaseDao
Parameters:
chain - to search in for the tests.
Returns:
List of TestCases

countCurrentlyQuarantinedTests

public int countCurrentlyQuarantinedTests(ImmutableChain chain)
Specified by:
countCurrentlyQuarantinedTests in interface TestCaseDao

getQuarantinedTestCasesForJob

@NotNull
public java.util.List<TestCase> getQuarantinedTestCasesForJob(@NotNull
                                                                      ImmutableJob job)
Description copied from interface: TestCaseDao
Provide a list of the quarantined tests for a job

Specified by:
getQuarantinedTestCasesForJob in interface TestCaseDao
Parameters:
job - to search in for the tests.
Returns:
List of TestCases

getMostFailingTestCasesForPlan

@NotNull
public java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForPlan(@NotNull
                                                                                                     PlanIdentifier plan)
Description copied from interface: TestCaseDao
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.

Specified by:
getMostFailingTestCasesForPlan in interface TestCaseDao
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 java.util.List<Pair<java.lang.Long,java.lang.Integer>> getMostFailingTestCasesForBuildResults(@NotNull
                                                                                                             java.util.List<BuildResultsSummary> buildResults)
Description copied from interface: TestCaseDao
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.

Specified by:
getMostFailingTestCasesForBuildResults in interface TestCaseDao
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 java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForPlan(@NotNull
                                                                                                    PlanIdentifier plan)
Description copied from interface: TestCaseDao
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.

Specified by:
getLongestToFixTestCasesForPlan in interface TestCaseDao
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 java.util.List<Pair<java.lang.Long,java.lang.Float>> getLongestToFixTestCasesForBuildResults(@NotNull
                                                                                                            java.util.List<BuildResultsSummary> buildResults)
Description copied from interface: TestCaseDao
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.

Specified by:
getLongestToFixTestCasesForBuildResults in interface TestCaseDao
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 java.util.List<Pair<java.lang.Long,java.lang.Integer>> getTopBrokenTests(@NotNull
                                                                                        PlanKey planKey,
                                                                                        BuildResultsFilter filter)
Specified by:
getTopBrokenTests in interface TestCaseDao

countTestCases

public long countTestCases()
Description copied from interface: TestCaseDao
Count all TestCase records

Specified by:
countTestCases in interface TestCaseDao
Returns:
number of TestCase records

scrollTestCasesForExport

public long scrollTestCasesForExport(@NotNull
                                     com.google.common.base.Function<TestCase,java.lang.Void> function)
Description copied from interface: TestCaseDao
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.

Specified by:
scrollTestCasesForExport in interface TestCaseDao
Parameters:
function - function to be executed on each of the TestCase records
Returns:
number of traversed rows


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.