diff options
Diffstat (limited to 'qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java')
-rw-r--r-- | qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java index 95f01d853a..a803120cc6 100644 --- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java +++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java @@ -61,6 +61,8 @@ public class TestResultAggregatorTest extends TestCase private static final int EXPECTED_NUMBER_OF_AGGREGATED_RESULTS = 3; + private static final int BATCH_SIZE = 3; + private TestResultAggregator _aggregator = new TestResultAggregator(); public void testAggregateResultsForTwoConsumerAndOneProducer() throws Exception @@ -76,19 +78,19 @@ public class TestResultAggregatorTest extends TestCase assertEquals(expectedNumberOfResults, aggregatedTestResult.getParticipantResults().size()); assertMinimalAggregatedResults( - aggregatedTestResult.getAllParticipantResult(), + aggregatedTestResult.getAllConsumerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, - NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1); + BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 0); assertMinimalAggregatedResults( - aggregatedTestResult.getAllConsumerParticipantResult(), + aggregatedTestResult.getAllProducerParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, - NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 0); + BATCH_SIZE, NUMBER_OF_MESSAGES_PRODUCED, 0, 1); assertMinimalAggregatedResults( - aggregatedTestResult.getAllProducerParticipantResult(), + aggregatedTestResult.getAllParticipantResult(), TEST1_NAME, TEST1_ITERATION_NUMBER, - NUMBER_OF_MESSAGES_PRODUCED, 0, 1); + BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1); } public void testAggregateResultsWhenParticipantErrored() @@ -103,10 +105,11 @@ public class TestResultAggregatorTest extends TestCase assertEquals(TestResultAggregator.AGGREGATED_ERROR_MESSAGE, aggregatedTestResult.getAllParticipantResult().getErrorMessage()); } - private void assertMinimalAggregatedResults(ParticipantResult result, String expectedTestName, int expectedIterationNumber, long expectedNumberOfMessagesProcessed, int expectedTotalNumberOfConsumers, int expectedTotalNumberOfProducers) + private void assertMinimalAggregatedResults(ParticipantResult result, String expectedTestName, int expectedIterationNumber, int expectedBatchSize, long expectedNumberOfMessagesProcessed, int expectedTotalNumberOfConsumers, int expectedTotalNumberOfProducers) { assertEquals("Unexpected test name in " + result.getParticipantName(), expectedTestName, result.getTestName()); assertEquals("Unexpected iteration number in " + result.getParticipantName(), expectedIterationNumber, result.getIterationNumber()); + assertEquals("Unexpected batch size " + result.getParticipantName(), expectedBatchSize, result.getBatchSize()); assertEquals("Unexpected number of messages processed in " + result.getParticipantName(), expectedNumberOfMessagesProcessed, result.getNumberOfMessagesProcessed()); assertEquals("Unexpected total number of consumers " + result.getParticipantName(), expectedTotalNumberOfConsumers, result.getTotalNumberOfConsumers()); assertEquals("Unexpected total number of producers " + result.getParticipantName(), expectedTotalNumberOfProducers, result.getTotalNumberOfProducers()); @@ -117,21 +120,21 @@ public class TestResultAggregatorTest extends TestCase 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, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER1_STARTDATE, CONSUMER1_ENDDATE, 1, 0); + 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); testResult.addParticipantResult(consumerResult1); ConsumerParticipantResult consumerResult2 = new ConsumerParticipantResult(); - setPropertiesOn(consumerResult2, TEST1_NAME, TEST1_ITERATION_NUMBER, CONSUMER_PARTICIPANT_NAME2, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER2_STARTDATE, CONSUMER2_ENDDATE, 1, 0); + 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); testResult.addParticipantResult(consumerResult2); ParticipantResult producerResult = new ProducerParticipantResult(); - setPropertiesOn(producerResult, TEST1_NAME, TEST1_ITERATION_NUMBER, PRODUCER_PARTICIPANT_NAME, NUMBER_OF_MESSAGES_PRODUCED, PAYLOAD_SIZE, TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE, 0, 1); + 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); testResult.addParticipantResult(producerResult); return testResult; } - private void setPropertiesOn(ParticipantResult participantResult, String testName, int iterationNumber, String participantName, long numberOfMessagesProcessed, int payloadSize, long totalPayloadProcessed, long start, long end, int totalNumberOfConsumers, int totalNumberOfProducers) + private void setPropertiesOn(ParticipantResult participantResult, String testName, int iterationNumber, String participantName, long numberOfMessagesProcessed, int batchSize, int payloadSize, long totalPayloadProcessed, long start, long end, int totalNumberOfConsumers, int totalNumberOfProducers) { participantResult.setParticipantName(participantName); participantResult.setTestName(testName); @@ -144,5 +147,6 @@ public class TestResultAggregatorTest extends TestCase participantResult.setTotalPayloadProcessed(totalPayloadProcessed); participantResult.setStartDate(new Date(start)); participantResult.setEndDate(new Date(end)); + participantResult.setBatchSize(batchSize); } } |