Search in sources :

Example 1 with TestResult

use of org.apache.qpid.disttest.controller.TestResult in project qpid-broker-j by apache.

the class TestResultAggregatorTest method testAggregateResultsForTwoConsumerAndOneProducer.

@Test
public void testAggregateResultsForTwoConsumerAndOneProducer() throws Exception {
    TestResult originalTestResult = createResultsFromTest();
    int numberOfOriginalParticipantResults = originalTestResult.getParticipantResults().size();
    int expectedNumberOfResults = numberOfOriginalParticipantResults + EXPECTED_NUMBER_OF_AGGREGATED_RESULTS;
    AggregatedTestResult aggregatedTestResult = _aggregator.aggregateTestResult(originalTestResult);
    aggregatedTestResult.getAllConsumerParticipantResult().getTotalPayloadProcessed();
    assertEquals((long) expectedNumberOfResults, (long) aggregatedTestResult.getParticipantResults().size());
    assertMinimalAggregatedResults(aggregatedTestResult.getAllConsumerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
    assertMinimalAggregatedResults(aggregatedTestResult.getAllProducerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_PRODUCED, 0, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
    assertMinimalAggregatedResults(aggregatedTestResult.getAllParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
}
Also used : TestResult(org.apache.qpid.disttest.controller.TestResult) Test(org.junit.Test)

Example 2 with TestResult

use of org.apache.qpid.disttest.controller.TestResult in project qpid-broker-j by apache.

the class TestResultAggregatorTest method createResultsFromTest.

private TestResult createResultsFromTest() {
    TestResult testResult = new TestResult(TEST1_NAME);
    ConsumerParticipantResult consumerResult1 = new ConsumerParticipantResult();
    setPropertiesOn(consumerResult1, TEST1_NAME, TEST1_ITERATION_NUMBER, CONSUMER_PARTICIPANT_NAME1, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER1_STARTDATE, CONSUMER1_ENDDATE, 1, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
    testResult.addParticipantResult(consumerResult1);
    ConsumerParticipantResult consumerResult2 = new ConsumerParticipantResult();
    setPropertiesOn(consumerResult2, TEST1_NAME, TEST1_ITERATION_NUMBER, CONSUMER_PARTICIPANT_NAME2, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER2_STARTDATE, CONSUMER2_ENDDATE, 1, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
    testResult.addParticipantResult(consumerResult2);
    ParticipantResult producerResult = new ProducerParticipantResult();
    setPropertiesOn(producerResult, TEST1_NAME, TEST1_ITERATION_NUMBER, PRODUCER_PARTICIPANT_NAME, NUMBER_OF_MESSAGES_PRODUCED, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE, 0, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
    testResult.addParticipantResult(producerResult);
    return testResult;
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult) TestResult(org.apache.qpid.disttest.controller.TestResult) ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult)

Example 3 with TestResult

use of org.apache.qpid.disttest.controller.TestResult in project qpid-broker-j by apache.

the class TestResultAggregatorTest method testAggregateResultsWhenParticipantErrored.

@Test
public void testAggregateResultsWhenParticipantErrored() {
    ParticipantResult failedParticipantResult = new ParticipantResult();
    failedParticipantResult.setParticipantName(PRODUCER_PARTICIPANT_NAME);
    failedParticipantResult.setErrorMessage("error");
    TestResult result = new TestResult(TEST1_NAME);
    result.addParticipantResult(failedParticipantResult);
    AggregatedTestResult aggregatedTestResult = _aggregator.aggregateTestResult(result);
    assertEquals(TestResultAggregator.AGGREGATED_ERROR_MESSAGE, aggregatedTestResult.getAllParticipantResult().getErrorMessage());
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult) TestResult(org.apache.qpid.disttest.controller.TestResult) Test(org.junit.Test)

Example 4 with TestResult

use of org.apache.qpid.disttest.controller.TestResult in project qpid-broker-j by apache.

the class TestResultAggregatorTest method testAggregateResultsForConsumerWithLatencyResults.

@Test
public void testAggregateResultsForConsumerWithLatencyResults() throws Exception {
    TestResult originalTestResult = createResultsFromTest();
    List<ParticipantResult> results = originalTestResult.getParticipantResults();
    for (ParticipantResult participantResult : results) {
        if (participantResult instanceof ConsumerParticipantResult) {
            ((ConsumerParticipantResult) participantResult).setMessageLatencies(SeriesStatisticsTest.SERIES);
            break;
        }
    }
    int numberOfOriginalParticipantResults = originalTestResult.getParticipantResults().size();
    int expectedNumberOfResults = numberOfOriginalParticipantResults + EXPECTED_NUMBER_OF_AGGREGATED_RESULTS;
    AggregatedTestResult aggregatedTestResult = _aggregator.aggregateTestResult(originalTestResult);
    aggregatedTestResult.getAllConsumerParticipantResult().getTotalPayloadProcessed();
    assertEquals((long) expectedNumberOfResults, (long) aggregatedTestResult.getParticipantResults().size());
    assertMinimalAggregatedResults(aggregatedTestResult.getAllConsumerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 0, PROVIDER_VERSION, PROTOCOL_VERSION);
    assertLatencyAggregatedResults(aggregatedTestResult.getAllConsumerParticipantResult());
    assertMinimalAggregatedResults(aggregatedTestResult.getAllProducerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_PRODUCED, 0, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
    assertMinimalAggregatedResults(aggregatedTestResult.getAllParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1, PROVIDER_VERSION, PROTOCOL_VERSION);
    int expectedThroughtput = (int) Math.round(NUMBER_OF_MESSAGES_PRODUCED * 1000.0d / (CONSUMER2_ENDDATE - PRODUCER_STARTDATE));
    ParticipantResult result = aggregatedTestResult.getAllParticipantResult();
    assertEquals("Unexpected message throughput", (long) expectedThroughtput, (long) result.getMessageThroughput());
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult) TestResult(org.apache.qpid.disttest.controller.TestResult) ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) Test(org.junit.Test)

Example 5 with TestResult

use of org.apache.qpid.disttest.controller.TestResult in project qpid-broker-j by apache.

the class ResultsTestFixture method createResultsForAllTests.

public ResultsForAllTests createResultsForAllTests() {
    ParticipantResult participantResult = mock(ParticipantResult.class);
    Map<ParticipantAttribute, Object> participantAttributes = getParticipantAttributes();
    when(participantResult.getAttributes()).thenReturn(participantAttributes);
    when(participantResult.getParticipantName()).thenReturn(PARTICIPANT);
    when(participantResult.getTestName()).thenReturn(TEST1);
    when(participantResult.getIterationNumber()).thenReturn(0);
    when(participantResult.getThroughput()).thenReturn(THROUGHPUT_VALUE);
    TestResult testResult = new TestResult(TEST1);
    testResult.addParticipantResult(participantResult);
    ResultsForAllTests resultsForAllTests = new ResultsForAllTests();
    resultsForAllTests.add(testResult);
    return resultsForAllTests;
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ParticipantAttribute(org.apache.qpid.disttest.message.ParticipantAttribute) ITestResult(org.apache.qpid.disttest.results.aggregation.ITestResult) TestResult(org.apache.qpid.disttest.controller.TestResult) ResultsForAllTests(org.apache.qpid.disttest.controller.ResultsForAllTests)

Aggregations

TestResult (org.apache.qpid.disttest.controller.TestResult)5 ParticipantResult (org.apache.qpid.disttest.message.ParticipantResult)4 ConsumerParticipantResult (org.apache.qpid.disttest.message.ConsumerParticipantResult)3 ProducerParticipantResult (org.apache.qpid.disttest.message.ProducerParticipantResult)3 Test (org.junit.Test)3 ResultsForAllTests (org.apache.qpid.disttest.controller.ResultsForAllTests)1 ParticipantAttribute (org.apache.qpid.disttest.message.ParticipantAttribute)1 ITestResult (org.apache.qpid.disttest.results.aggregation.ITestResult)1