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);
}
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;
}
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());
}
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());
}
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;
}
Aggregations