Package org.apache.qpid.disttest.message

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


        boolean hasError = aggregateOriginalResults(originalTestResult,
                                     consumerResultAggregator,
                                     producerResultAggregator);

        ParticipantResult aggregatedProducerResult = producerResultAggregator.getAggregatedResult();
        ParticipantResult aggregaredConsumerResult = consumerResultAggregator.getAggregatedResult();

        ParticipantResult aggregatedAllResult = aggregateAggregatedResults(
                aggregatedResultsAggregator, aggregatedProducerResult,
                aggregaredConsumerResult);

        applyNonAggregateablesToAll(aggregatedAllResult,
                aggregatedProducerResult, aggregaredConsumerResult);

        AggregatedTestResult newTestResult = new AggregatedTestResult(originalTestResult);
        newTestResult.setAllProducerParticipantResult(aggregatedProducerResult);
        newTestResult.setAllConsumerParticipantResult(aggregaredConsumerResult);
        newTestResult.setAllParticipantResult(aggregatedAllResult);

        if (hasError)
        {
            aggregatedAllResult.setErrorMessage(TestResultAggregator.AGGREGATED_ERROR_MESSAGE);
        }

        return newTestResult;
    }
View Full Code Here


            ParticipantResult aggregatedProducerResult,
            ParticipantResult aggregaredConsumerResult)
    {
        aggregatedResultsAggregator.aggregate(aggregatedProducerResult);
        aggregatedResultsAggregator.aggregate(aggregaredConsumerResult);
        ParticipantResult aggregatedAllResult = aggregatedResultsAggregator.getAggregatedResult();
        return aggregatedAllResult;
    }
View Full Code Here

                BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1);
    }

    public void testAggregateResultsWhenParticipantErrored()
    {
        ParticipantResult failedParticipantResult = new ParticipantResult();
        failedParticipantResult.setParticipantName(PRODUCER_PARTICIPANT_NAME);
        failedParticipantResult.setErrorMessage("error");
        TestResult result = new TestResult(TEST1_NAME);
        result.addParticipantResult(failedParticipantResult);

        AggregatedTestResult aggregatedTestResult = _aggregator.aggregateTestResult(result);
        assertEquals(TestResultAggregator.AGGREGATED_ERROR_MESSAGE, aggregatedTestResult.getAllParticipantResult().getErrorMessage());
View Full Code Here

                aggregatedTestResult.getAllParticipantResult(),
                TEST1_NAME, TEST1_ITERATION_NUMBER,
                BATCH_SIZE, NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1);

        int expectedThroughtput = (int)Math.round(NUMBER_OF_MESSAGES_PRODUCED * 1000.0d /(CONSUMER2_ENDDATE - PRODUCER_STARTDATE));
        ParticipantResult result = aggregatedTestResult.getAllParticipantResult();
        assertEquals("Unexpected message throughtput", expectedThroughtput, result.getMessageThroughput());
    }
View Full Code Here

        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);
        testResult.addParticipantResult(producerResult);

        return testResult;
    }
View Full Code Here

    private static final double EXPECTED_AGGREGATED_ALL_THROUGHPUT = ((OVERALL_PROCESSED)/1024)/((OVERALL_TIMETAKEN)/1000);
    private static final int EXPECTED_AGGREGATED_MESSAGE_THROUGHPUT = (int)(OVERALL_NUMBER_OF_MESSAGES_PROCESSED * 1000.0d/OVERALL_TIMETAKEN);

    public void testStartAndEndDateForOneParticipantResult()
    {
        ParticipantResult result = new ParticipantResult();
        result.setStartDate(new Date(PARTICIPANT1_STARTDATE));
        result.setEndDate(new Date(PARTICIPANT1_ENDDATE));

        _aggregator.aggregate(result);
        ParticipantResult aggregratedResult = _aggregator.getAggregatedResult();
        assertEquals(PARTICIPANT1_STARTDATE, aggregratedResult.getStartInMillis());
        assertEquals(PARTICIPANT1_ENDDATE, aggregratedResult.getEndInMillis());
    }
View Full Code Here

        assertEquals(PARTICIPANT1_ENDDATE, aggregratedResult.getEndInMillis());
    }

    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 aggregratedResult = _aggregator.getAggregatedResult();
        assertEquals(PARTICIPANT1_STARTDATE, aggregratedResult.getStartInMillis());
        assertEquals(PARTICIPANT2_ENDDATE, aggregratedResult.getEndInMillis());
    }
View Full Code Here

        {
            LOGGER.info("Consumer {} finished consuming. Number of messages consumed: {}",
                        getName(), numberOfMessagesReceived);
        }

        ParticipantResult result = _resultFactory.createForConsumer(
                getName(),
                registeredClientName,
                _command,
                acknowledgeMode,
                numberOfMessagesReceived,
View Full Code Here

        assertEquals(PARTICIPANT2_ENDDATE, aggregratedResult.getEndInMillis());
    }

    public void testComputeNumberOfMessagesProcessed()
    {
        ParticipantResult result1 = new ParticipantResult();
        result1.setNumberOfMessagesProcessed(10);

        ParticipantResult result2 = new ParticipantResult();
        result2.setNumberOfMessagesProcessed(15);

        _aggregator.aggregate(result1);
        _aggregator.aggregate(result2);

        ParticipantResult aggregratedResult = _aggregator.getAggregatedResult();
        assertEquals(25, aggregratedResult.getNumberOfMessagesProcessed());
    }
View Full Code Here

        assertEquals(25, aggregratedResult.getNumberOfMessagesProcessed());
    }

    public void testComputeTotalPayloadProcessed()
    {
        ParticipantResult result1 = new ParticipantResult();
        result1.setTotalPayloadProcessed(PARTICIPANT1_TOTAL_PROCESSED);

        ParticipantResult result2 = new ParticipantResult();
        result2.setTotalPayloadProcessed(PARTICIPANT2_TOTAL_PROCESSED);

        _aggregator.aggregate(result1);
        _aggregator.aggregate(result2);

        ParticipantResult aggregratedResult = _aggregator.getAggregatedResult();
        assertEquals(OVERALL_PROCESSED, aggregratedResult.getTotalPayloadProcessed());
    }
View Full Code Here

TOP

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

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.