Search in sources :

Example 11 with ParticipantResult

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());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Test(org.junit.Test)

Example 12 with ParticipantResult

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());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Test(org.junit.Test)

Example 13 with ParticipantResult

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());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Date(java.util.Date) Test(org.junit.Test)

Example 14 with ParticipantResult

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());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Date(java.util.Date) Test(org.junit.Test)

Example 15 with ParticipantResult

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());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Test(org.junit.Test)

Aggregations

ParticipantResult (org.apache.qpid.disttest.message.ParticipantResult)38 Test (org.junit.Test)25 ConsumerParticipantResult (org.apache.qpid.disttest.message.ConsumerParticipantResult)9 ProducerParticipantResult (org.apache.qpid.disttest.message.ProducerParticipantResult)9 ITestResult (org.apache.qpid.disttest.results.aggregation.ITestResult)6 Date (java.util.Date)5 TestResult (org.apache.qpid.disttest.controller.TestResult)4 ResultsForAllTests (org.apache.qpid.disttest.controller.ResultsForAllTests)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 Message (javax.jms.Message)2 ParticipantAttribute (org.apache.qpid.disttest.message.ParticipantAttribute)2 TreeSet (java.util.TreeSet)1 MessageListener (javax.jms.MessageListener)1 Context (javax.naming.Context)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 Transformer (javax.xml.transform.Transformer)1 TransformerException (javax.xml.transform.TransformerException)1 DOMSource (javax.xml.transform.dom.DOMSource)1