use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testConstantAcknowledgeModesRolledUp.
@Test
public void testConstantAcknowledgeModesRolledUp() throws Exception {
ParticipantResult result1 = new ParticipantResult();
result1.setAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE);
ParticipantResult result2 = new ParticipantResult();
result2.setAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) Session.DUPS_OK_ACKNOWLEDGE, (long) aggregatedResult.getAcknowledgeMode());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testConstantBatchSizesRolledUp.
@Test
public void testConstantBatchSizesRolledUp() throws Exception {
final int batchSize = 10;
ParticipantResult result1 = new ParticipantResult();
result1.setBatchSize(batchSize);
ParticipantResult result2 = new ParticipantResult();
result2.setBatchSize(batchSize);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) batchSize, (long) aggregatedResult.getBatchSize());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testStartAndEndDateForOneParticipantResult.
@Test
public void testStartAndEndDateForOneParticipantResult() {
ParticipantResult result = new ParticipantResult();
result.setStartDate(new Date(PARTICIPANT1_STARTDATE));
result.setEndDate(new Date(PARTICIPANT1_ENDDATE));
_aggregator.aggregate(result);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals(PARTICIPANT1_STARTDATE, aggregatedResult.getStartInMillis());
assertEquals(PARTICIPANT1_ENDDATE, aggregatedResult.getEndInMillis());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testStartAndEndDateForTwoParticipantResults.
@Test
public void testStartAndEndDateForTwoParticipantResults() {
ParticipantResult result1 = new ParticipantResult();
result1.setStartDate(new Date(PARTICIPANT1_STARTDATE));
result1.setEndDate(new Date(PARTICIPANT1_ENDDATE));
ParticipantResult result2 = new ParticipantResult();
result2.setStartDate(new Date(PARTICIPANT2_STARTDATE));
result2.setEndDate(new Date(PARTICIPANT2_ENDDATE));
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals(PARTICIPANT1_STARTDATE, aggregatedResult.getStartInMillis());
assertEquals(PARTICIPANT2_ENDDATE, aggregatedResult.getEndInMillis());
}
use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.
the class ParticipantResultAggregatorTest method testComputeNumberOfMessagesProcessed.
@Test
public void testComputeNumberOfMessagesProcessed() {
ParticipantResult result1 = new ParticipantResult();
result1.setNumberOfMessagesProcessed(10);
ParticipantResult result2 = new ParticipantResult();
result2.setNumberOfMessagesProcessed(15);
_aggregator.aggregate(result1);
_aggregator.aggregate(result2);
ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
assertEquals((long) 25, aggregatedResult.getNumberOfMessagesProcessed());
}
Aggregations