Package org.apache.qpid.disttest.message

Examples of org.apache.qpid.disttest.message.ConsumerParticipantResult


    CSVOrderParticipantResultComparator _comparator = new CSVOrderParticipantResultComparator();

    public void testOrderedConsumerParticipants() throws Exception
    {
        assertCompare(
                new ConsumerParticipantResult("apple"),
                new ConsumerParticipantResult("banana"));

    }
View Full Code Here


    }
    public void testProducerPrecedesConsumerParticipants() throws Exception
    {
        assertCompare(
                new ProducerParticipantResult(),
                new ConsumerParticipantResult());
    }
View Full Code Here

    }

    public void testConsumerPrecedesAllConsumersResult()
    {
        assertCompare(
                new ConsumerParticipantResult("participantName"),
                new ParticipantResult(TestResultAggregator.ALL_CONSUMER_PARTICIPANTS_NAME));
    }
View Full Code Here

        int totalNumberOfConsumers = 1;
        int totalNumberOfProducers = 0;

        int acknowledgeMode = 2;

        ConsumerParticipantResult result = _participantResultFactory.createForConsumer(PARTICIPANT_NAME,
                                                                                       REGISTERED_CLIENT_NAME,
                                                                                       command,
                                                                                       acknowledgeMode,
                                                                                       NUMBER_OF_MESSAGES_PROCESSED,
                                                                                       PAYLOAD_SIZE,
                                                                                       TOTAL_PAYLOAD_PROCESSED,
                                                                                       START, END);

        assertCommonResultProperties(result);

        assertEquals(topic,                  result.isTopic());
        assertEquals(durable,                result.isDurableSubscription());
        assertEquals(browsingSubscription,   result.isBrowsingSubscription());
        assertEquals(isSelector,             result.isSelector());
        assertEquals(noLocal,                result.isNoLocal());
        assertEquals(synchronousConsumer,    result.isSynchronousConsumer());
        assertEquals(totalNumberOfConsumers, result.getTotalNumberOfConsumers());
        assertEquals(totalNumberOfProducers, result.getTotalNumberOfProducers());
    }
View Full Code Here

        {
            rollupConstantAttributes(result);
            computeVariableAttributes(result);
            if (result instanceof ConsumerParticipantResult)
            {
                ConsumerParticipantResult consumerParticipantResult = (ConsumerParticipantResult)result;
                _latencyStatistics.addMessageLatencies(consumerParticipantResult.getMessageLatencies());
                _latencyStatistics.aggregate();
            }
        }
    }
View Full Code Here

    public ParticipantResult getAggregatedResult()
    {
        ParticipantResult aggregatedResult;
        if (_targetClass == ConsumerParticipantResult.class)
        {
            ConsumerParticipantResult consumerParticipantResult = new ConsumerParticipantResult(_aggregatedResultName);
            consumerParticipantResult.setAverageLatency(_latencyStatistics.getAverage());
            consumerParticipantResult.setMinLatency(_latencyStatistics.getMinimum());
            consumerParticipantResult.setMaxLatency(_latencyStatistics.getMaximum());
            consumerParticipantResult.setLatencyStandardDeviation(_latencyStatistics.getStandardDeviation());
            aggregatedResult = consumerParticipantResult;
        }
        else
        {
            aggregatedResult = new ParticipantResult(_aggregatedResultName);
View Full Code Here

            ProducerParticipantResult producerParticipantResult = (ProducerParticipantResult) result;
            _encounteredDeliveryModes.add(producerParticipantResult.getDeliveryMode());
        }
        else if(result instanceof ConsumerParticipantResult)
        {
            ConsumerParticipantResult consumerParticipantResult = (ConsumerParticipantResult)result;
            _encounteredDurableSubscriptions.add(consumerParticipantResult.isDurableSubscription());
            _encounteredTopics.add(consumerParticipantResult.isTopic());
        }
    }
View Full Code Here

                producerParticipantResult.setDeliveryMode(_encounteredDeliveryModes.first());
            }
        }
        if (aggregatedResult instanceof ConsumerParticipantResult)
        {
            ConsumerParticipantResult consumerParticipantResult = (ConsumerParticipantResult) aggregatedResult;
            if(_encounteredDurableSubscriptions.size() == 1)
            {
                consumerParticipantResult.setDurableSubscription(_encounteredDurableSubscriptions.first());
            }
            if(_encounteredTopics.size() == 1)
            {
                consumerParticipantResult.setTopic(_encounteredTopics.first());
            }
        }
    }
View Full Code Here

    }

    private void assertLatencyAggregatedResults(ParticipantResult allConsumerParticipantResult)
    {
        assertTrue("Unexpected result", allConsumerParticipantResult instanceof ConsumerParticipantResult);
        ConsumerParticipantResult results = (ConsumerParticipantResult)allConsumerParticipantResult;
        assertEquals("Unexpected average", 5.0, results.getAverageLatency(), 0.01);
        assertEquals("Unexpected min", 2, results.getMinLatency());
        assertEquals("Unexpected max", 9, results.getMaxLatency());
        assertEquals("Unexpected standard deviation", 2.0, results.getLatencyStandardDeviation(), 0.01);
    }
View Full Code Here

    private TestResult createResultsFromTest()
    {
        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, 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, 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, BATCH_SIZE, PAYLOAD_SIZE, TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE, 0, 1);
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.message.ConsumerParticipantResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.