Package org.apache.qpid.disttest.controller

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


        assertEquals(expectedCsvContents, FileUtils.readFileAsString(resultsFile));
    }

    public void testWriteResultsSummary()
    {
        ResultsForAllTests results1 = mock(ResultsForAllTests.class);
        ResultsForAllTests results2 = mock(ResultsForAllTests.class);
        ResultsForAllTests summaryResults = mock(ResultsForAllTests.class);

        when(_testResultAggregator.aggregateTestResults(Arrays.asList(results1, results2)))
            .thenReturn(summaryResults);

        String expectedSummaryFileContents = "expected-summary-file";
View Full Code Here


        when(participantResult.getThroughput()).thenReturn(THROUGHPUT_VALUE);

        TestResult testResult = new TestResult(TEST1);
        testResult.addParticipantResult(participantResult);

        ResultsForAllTests resultsForAllTests = new ResultsForAllTests();
        resultsForAllTests.add(testResult);
        return resultsForAllTests;
    }
View Full Code Here

    private CSVFormatter _formatter = new CSVFormatter();

    public void testResultsFileWithWithOneRow() throws Exception
    {
        ResultsTestFixture resultsTestFixture = new ResultsTestFixture();
        ResultsForAllTests resultsForAllTests = resultsTestFixture.createResultsForAllTests();

        String output = _formatter.format(resultsForAllTests);

        String expectedOutput = readCsvOutputFileAsString("expectedOutput.csv");
View Full Code Here

        writeResultsToOutputFile(resultsForAllTests, outputFile);
    }

    public void writeResultsSummary(List<ResultsForAllTests> allResultsList)
    {
        ResultsForAllTests combinedResults = _testResultAggregator.aggregateTestResults(allResultsList);
        writeResultsToOutputFile(combinedResults, new File(_outputDir, TEST_SUMMARY_FILE_NAME).getAbsolutePath());
    }
View Full Code Here

    private TestResultAggregator _testResultAggregator = new TestResultAggregator();

    public ResultsForAllTests aggregateResults(ResultsForAllTests rawResultsForAllTests)
    {

        ResultsForAllTests aggregatedResultsForAllTests = new ResultsForAllTests();


        for (ITestResult testResult : rawResultsForAllTests.getTestResults())
        {
            AggregatedTestResult aggregateTestResult = _testResultAggregator.aggregateTestResult(testResult);
            aggregatedResultsForAllTests.add(aggregateTestResult);
        }


        return aggregatedResultsForAllTests;
    }
View Full Code Here

     * Produces a single {@link ResultsForAllTests} from the supplied list, only containing
     * the "All participants" results.
     */
    public ResultsForAllTests aggregateTestResults(List<ResultsForAllTests> allResultsList)
    {
        ResultsForAllTests retVal = new ResultsForAllTests();

        for (ResultsForAllTests resultsForAllTests : allResultsList)
        {
            ResultsForAllTests allParticipantsResult = resultsForAllTests.getAllParticipantsResult();
            for (ITestResult testResult : allParticipantsResult.getTestResults())
            {
                retVal.add(testResult);
            }
        }

View Full Code Here

    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

        _controller.setConfig(config);
        final Client client1 = new Client(new ClientJmsDelegate(_context));
        final Thread client1Thread = createBackgroundClientThread(client1);
        _controller.awaitClientRegistrations();

        ResultsForAllTests results = _controller.runAllTests();
        _controller.stopAllRegisteredClients();

        assertClientThreadsShutdown(client1Thread);
        assertClientsStopped(ClientState.STOPPED, client1);
        assertFalse("Test should have no errors", results.hasErrors());
        List<ITestResult> allTestResults = results.getTestResults();
        assertEquals("Unexpected number of test results", 1, allTestResults.size());
        ITestResult testResult1 = allTestResults.get(0);
        assertEquals("Unexpected test name", "Test 1", testResult1.getName());
        List<ParticipantResult> test1ParticipantResults = testResult1.getParticipantResults();
        assertEquals("Unexpected number of participant results for test 1", 1, test1ParticipantResults.size());
View Full Code Here

        final Thread client1Thread = createBackgroundClientThread(client1);
        final Thread client2Thread = createBackgroundClientThread(client2);

        _controller.awaitClientRegistrations();

        ResultsForAllTests results = _controller.runAllTests();
        _controller.stopAllRegisteredClients();

        assertClientThreadsShutdown(client1Thread, client2Thread);
        assertClientsStopped(ClientState.STOPPED, client1, client2);

        assertFalse("Test should have no errors", results.hasErrors());

        List<TestResult> allTestResults = (List)results.getTestResults();
        assertEquals("Unexpected number of test results", expectedNumberOfTests, allTestResults.size());

        return allTestResults;
    }
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.