Class TestCaseResultHibernateDao

    • Constructor Detail

      • TestCaseResultHibernateDao

        public TestCaseResultHibernateDao()
    • Method Detail

      • findById

        public TestCaseResult findById​(long id)
        Description copied from interface: TestCaseResultDao
        Find a specific testCaseResult by id
        Specified by:
        findById in interface TestCaseResultDao
        Parameters:
        id - of the test you want to find
        Returns:
        the testCaseResult corresponding to the id provided.
      • getTestsForBuildResultByState

        @NotNull
        public @NotNull List<TestCaseResult> getTestsForBuildResultByState​(ResultsSummary summary,
                                                                           TestState state,
                                                                           int firstResult,
                                                                           int unvalidatedMaxCount)
        Description copied from interface: TestCaseResultDao
        Retrieves a list of testCaseResults for a BuildResultSummary based on their state (e.f FAILED or SUCCESS). To be used whenever pagination is required.
        Specified by:
        getTestsForBuildResultByState in interface TestCaseResultDao
        Parameters:
        summary - the BuildResultsSummary to get the tests for
        state - the TestState to search for.
        firstResult - the first record to be retrieved. Negative values are treated as 0.
        unvalidatedMaxCount - maximum amount of records to be retrieved. Values less than or equal to 0 are ignored.
        Returns:
        a list of testCaseResults for a BuildResultSummary with the given state
      • getTestsForBuildResultByDeltaState

        @NotNull
        public @NotNull List<TestCaseResult> getTestsForBuildResultByDeltaState​(ResultsSummary summary,
                                                                                TestDeltaState deltaState,
                                                                                int firstResult,
                                                                                int unvalidatedMaxCount)
        Description copied from interface: TestCaseResultDao
        Retrieves a list of testCaseResults for a BuildResultSummary based on their delta state (e.g BROKEN, FIXED)
        Specified by:
        getTestsForBuildResultByDeltaState in interface TestCaseResultDao
        Parameters:
        summary - the BuildResultsSummary to get the tests for
        deltaState - the TestDeltaState to search for.
        firstResult - the first record to be retrieved. Negative values are treated as 0.
        unvalidatedMaxCount - maximum amount of records to be retrieved. Values less than or equal to 0 are ignored.
        Returns:
        a list of testCaseResults for a BuildResultSummary with the given delta state
      • getTestsForChainResultByDeltaStates

        @NotNull
        public @NotNull List<TestCaseResult> getTestsForChainResultByDeltaStates​(ChainResultsSummary summary,
                                                                                 TestDeltaState[] deltaStates,
                                                                                 int firstResult,
                                                                                 int unvalidatedMaxCount)
        Description copied from interface: TestCaseResultDao
        Retrieves a list of testCaseResults for a ChainResultSummary based on their delta state (e.g BROKEN, FIXED)
        Specified by:
        getTestsForChainResultByDeltaStates in interface TestCaseResultDao
        firstResult - - index of the first result
        unvalidatedMaxCount - - maximum amount of records returned
        Returns:
        testCaseResults
      • getLastNFailingResultsForTestCase

        @NotNull
        public @NotNull List<Pair<TestCaseResult,​Integer>> getLastNFailingResultsForTestCase​(@NotNull
                                                                                                   @NotNull TestCase testCase,
                                                                                                   int number)
        Description copied from interface: TestCaseResultDao
        Retrieve the last n failing testResults for this given test case, latest first.
        Specified by:
        getLastNFailingResultsForTestCase in interface TestCaseResultDao
        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
        public @NotNull List<Pair<TestCaseResult,​Integer>> getLastNFailingResultsForTestCaseAndBuildResults​(@NotNull
                                                                                                                  @NotNull TestCase testCase,
                                                                                                                  @NotNull
                                                                                                                  @NotNull List<BuildResultsSummary> buildResults,
                                                                                                                  int number)
        Description copied from interface: TestCaseResultDao
        Retrieve the last n failing testResults for this given test case, but only those that occurred within the provided build results. Latest first.
        Specified by:
        getLastNFailingResultsForTestCaseAndBuildResults in interface TestCaseResultDao
        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.
      • getTestCaseResults

        @NotNull
        public @NotNull List<TestCaseResult> getTestCaseResults​(TestCase testCase,
                                                                long buildNumber)
        Description copied from interface: TestCaseResultDao
        Find a specific run of a testCase
        Specified by:
        getTestCaseResults in interface TestCaseResultDao
        Parameters:
        testCase - to look for
        buildNumber - of the build the run should have occurred in
        Returns:
        the TestCaseResult for the given test case, if it ran in the given build.
      • getSucceedingSinceBuildResultSummary

        public BuildResultsSummary getSucceedingSinceBuildResultSummary​(TestCase testCase)
        Description copied from interface: TestCaseResultDao
        Find the build in which the given test has been successful since. AKA the last recored "FIXED" test run. Will return null if the test has never failed (ie being successful since the beginning)
        Specified by:
        getSucceedingSinceBuildResultSummary in interface TestCaseResultDao
        Parameters:
        testCase - to search history for.
        Returns:
        the BuildResultSummary that this test has been successful since.
      • scrollTestCaseResultsForExport

        public long scrollTestCaseResultsForExport​(@NotNull
                                                   @NotNull Consumer<TestCaseResult> consumer)
        Description copied from interface: TestCaseResultDao
        Scroll through and execute function for each of TestCaseResults Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
        Specified by:
        scrollTestCaseResultsForExport in interface TestCaseResultDao
        Parameters:
        consumer - consumer to accept each of the TestClassResults
        Returns:
        number of traversed rows
      • scrollTestCaseResultErrorsForExport

        public long scrollTestCaseResultErrorsForExport​(@NotNull
                                                        @NotNull Consumer<TestCaseResultError> consumer)
        Description copied from interface: TestCaseResultDao
        Scroll through and execute function for each of TestCaseResultErrors Objects passed to function are not fully initialized. Collections are empty and related objects have only id set.
        Specified by:
        scrollTestCaseResultErrorsForExport in interface TestCaseResultDao
        Parameters:
        consumer - consumer to accept each of the TestCaseResultErrors
        Returns:
        number of traversed rows