use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testDifferingPayloadSizesNotRolledUp.
@Test
public void testDifferingPayloadSizesNotRolledUp() throws Exception {
final int payload1Size = 1024;
final int payload2Size = 2048;
ParticipantResult result1 = new ParticipantResult();
result1.setPayloadSize(payload1Size);
ParticipantResult result2 = new ParticipantResult();
result2.setPayloadSize(payload2Size);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) 0, (long) aggregatedResult.getPayloadSize());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testDifferingBatchSizesNotRolledUp.
@Test
public void testDifferingBatchSizesNotRolledUp() throws Exception {
final int batch1Size = 10;
final int batch2Size = 20;
ParticipantResult result1 = new ParticipantResult();
result1.setBatchSize(batch1Size);
ParticipantResult result2 = new ParticipantResult();
result2.setBatchSize(batch2Size);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) 0, (long) aggregatedResult.getBatchSize());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testDifferingProviderVersionNotRolledUp.
@Test
public void testDifferingProviderVersionNotRolledUp() throws Exception {
ParticipantResult result1 = new ParticipantResult();
result1.setProtocolVersion("PROVIDER_VERSION1");
ParticipantResult result2 = new ParticipantResult();
result2.setProtocolVersion("PROVIDER_VERSION2");
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertNull(aggregatedResult.getProviderVersion());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testComputeMessageThroughput.
@Test
public void testComputeMessageThroughput() {
ParticipantResult result1 = new ParticipantResult();
result1.setStartDate(new Date(PARTICIPANT1_STARTDATE));
result1.setEndDate(new Date(PARTICIPANT1_ENDDATE));
result1.setNumberOfMessagesProcessed(PARTICIPANT1_NUMBER_OF_MESSAGES_PROCESSED);
ParticipantResult result2 = new ParticipantResult();
result2.setStartDate(new Date(PARTICIPANT2_STARTDATE));
result2.setEndDate(new Date(PARTICIPANT2_ENDDATE));
result2.setNumberOfMessagesProcessed(PARTICIPANT2_NUMBER_OF_MESSAGES_PROCESSED);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) EXPECTED_AGGREGATED_MESSAGE_THROUGHPUT, (long) aggregatedResult.getMessageThroughput());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testSumNumberOfConsumerAndProducers.
@Test
public void testSumNumberOfConsumerAndProducers() throws Exception {
final int expectedNumberOfProducers = 1;
final int expectedNumberOfConsumers = 2;
ParticipantResult result1 = new ParticipantResult();
result1.setTotalNumberOfConsumers(1);
ParticipantResult result2 = new ParticipantResult();
result2.setTotalNumberOfConsumers(1);
ParticipantResult result3 = new ParticipantResult();
result2.setTotalNumberOfProducers(1);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
_aggregator.aggregate(result3);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) expectedNumberOfConsumers, (long) aggregatedResult.getTotalNumberOfConsumers());
assertEquals((long) expectedNumberOfProducers, (long) aggregatedResult.getTotalNumberOfProducers());
}
Aggregations