Search in sources :

Example 6 with ParticipantResult

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

Example 7 with ParticipantResult

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

Example 8 with ParticipantResult

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

Example 9 with ParticipantResult

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

Example 10 with ParticipantResult

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