Class TestCaseHibernateDao

    • 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 @NotNull List<TestCase> getLongestRunningTestCasesForPlan​(@NotNull
                                                                         @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 @NotNull List<TestCase> getQuarantinedTestCasesForChain​(@NotNull
                                                                       @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
      • getQuarantinedTestCasesForJob

        @NotNull
        public @NotNull List<TestCase> getQuarantinedTestCasesForJob​(@NotNull
                                                                     @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 @NotNull List<Pair<Long,​Long>> getMostFailingTestCasesForPlan​(@NotNull
                                                                                   @NotNull ImmutablePlan 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 @NotNull List<Pair<Long,​Long>> getMostFailingTestCasesForBuildResults​(@NotNull
                                                                                           @NotNull 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 @NotNull List<Pair<Long,​Float>> getLongestToFixTestCasesForPlan​(@NotNull
                                                                                     @NotNull ImmutablePlan 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 @NotNull List<Pair<Long,​Float>> getLongestToFixTestCasesForBuildResults​(@NotNull
                                                                                             @NotNull 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)
      • 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
                                             @NotNull Consumer<TestCase> consumer)
        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:
        consumer - consumer to accept each of the TestCase records
        Returns:
        number of traversed rows