Package org.apache.qpid.disttest.controller

Examples of org.apache.qpid.disttest.controller.ResultsForAllTests


    private TestResultAggregator _aggregator = new TestResultAggregator();

    public void testAggregateTestResults()
    {
        ResultsForAllTests resultsForAllTests1 = mock(ResultsForAllTests.class);
        ResultsForAllTests resultsForAllTests2 = mock(ResultsForAllTests.class);

        ResultsForAllTests summaryResult1 = mock(ResultsForAllTests.class);
        ResultsForAllTests summaryResult2 = mock(ResultsForAllTests.class);

        when(resultsForAllTests1.getAllParticipantsResult()).thenReturn(summaryResult1);
        when(resultsForAllTests2.getAllParticipantsResult()).thenReturn(summaryResult2);

        ITestResult testResult1 = mock(ITestResult.class);
        ITestResult testResult2 = mock(ITestResult.class);

        when(summaryResult1.getTestResults()).thenReturn(Arrays.asList(testResult1));
        when(summaryResult2.getTestResults()).thenReturn(Arrays.asList(testResult2));

        ResultsForAllTests actualSummaryResults = _aggregator.aggregateTestResults(Arrays.asList(
                resultsForAllTests1,
                resultsForAllTests2));

        assertEquals(
                "Summary results should contain the all the 'all participants' test results",
                Arrays.asList(testResult1, testResult2),
                actualSummaryResults.getTestResults());
    }
View Full Code Here


        _aggregator.setTestResultAggregator(_testResultAggregator);
    }

    public void testAggregrateManyTestResults() throws Exception
    {
        ResultsForAllTests resultsForAllTests = mock(ResultsForAllTests.class);
        ITestResult testResult1 = mock(ITestResult.class);
        ITestResult testResult2 = mock(ITestResult.class);

        when(resultsForAllTests.getTestResults()).thenReturn(Arrays.asList(testResult1, testResult2));
        when(_testResultAggregator.aggregateTestResult(testResult1)).thenReturn(mock(AggregatedTestResult.class));
        when(_testResultAggregator.aggregateTestResult(testResult2)).thenReturn(mock(AggregatedTestResult.class));

        ResultsForAllTests aggregatedResultsForAllTests = _aggregator.aggregateResults(resultsForAllTests);
        assertEquals(2, aggregatedResultsForAllTests.getTestResults().size());

        verify(_testResultAggregator).aggregateTestResult(testResult1);
        verify(_testResultAggregator).aggregateTestResult(testResult2);

    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.controller.ResultsForAllTests

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.