Package org.apache.qpid.disttest.message

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


    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 aggregratedResult = _aggregator.getAggregatedResult();
        assertEquals(expectedNumberOfConsumers, aggregratedResult.getTotalNumberOfConsumers());
        assertEquals(expectedNumberOfProducers, aggregratedResult.getTotalNumberOfProducers());
    }
View Full Code Here


            }
        }

        private void runParticipantAndSendResults()
        {
            ParticipantResult result = null;
            try
            {
                if (LOGGER.isDebugEnabled())
                {
                    LOGGER.debug("About to run participant " + _participant);
View Full Code Here

    private void assertTestResultMessageSize(TestResult testResult, int iterationNumber, int expectedMessageSize, int expectedNumberOfMessages)
    {
        List<ParticipantResult> test1ParticipantResults = testResult.getParticipantResults();
        assertEquals("Unexpected number of participant results for test", 2, test1ParticipantResults.size());

        ParticipantResult producer1 = test1ParticipantResults.get(1);

        assertEquals(expectedMessageSize, producer1.getPayloadSize());
        assertEquals(iterationNumber, producer1.getIterationNumber());
    }
View Full Code Here

        assertEquals("Size of list of expected participant names is different from actual", expectedOrderedParticipantNames.length, participants.size());

        for (int i = 0; i < expectedOrderedParticipantNames.length; i++)
        {
            String expectedParticipantName = expectedOrderedParticipantNames[i];
            ParticipantResult participant = participants.get(i);
            assertEquals(expectedParticipantName, participant.getParticipantName());
        }
    }
View Full Code Here

    @Override
    public void writeResults(ResultsForAllTests resultsForAllTests, String testConfigFile)
    {
        for (ITestResult allResult : resultsForAllTests.getAllParticipantsResult().getTestResults())
        {
            ParticipantResult allRowData = allResult.getParticipantResults().iterator().next();

            if (allRowData.getErrorMessage() == null)
            {
                final String output;
                if (_reportMessageTotals)
                {
                    output = String.format("%s : %,d (total payload/bytes) : %,d (time taken/ms) : %,d (total messages) : %,d (messages/s) %,.2f (Kbytes/s)",
                            allResult.getName(), allRowData.getTotalPayloadProcessed(), allRowData.getTimeTaken(), allRowData.getNumberOfMessagesProcessed(), allRowData.getMessageThroughput(), allRowData.getThroughput());
                }
                else
                {
                    output = String.format("%s : %,d (messages/s) %,.2f (Kbytes/s)", allResult.getName(), allRowData.getMessageThroughput(), allRowData.getThroughput());
                }
                System.out.println(output);
            }
            else
            {
                System.err.println(allRowData.getErrorMessage());
            }
        }
    }
View Full Code Here

            }
        }

        private void runParticipantAndSendResults()
        {
            ParticipantResult result = null;
            try
            {
                if (LOGGER.isDebugEnabled())
                {
                    LOGGER.debug("About to run participant " + _participant);
View Full Code Here

    }

    public void testCreateForError()
    {
        String errorMessage = "error";
        ParticipantResult result = _participantResultFactory.createForError(PARTICIPANT_NAME, REGISTERED_CLIENT_NAME, errorMessage);
        assertEquals(PARTICIPANT_NAME, result.getParticipantName());
        assertEquals(REGISTERED_CLIENT_NAME, result.getRegisteredClientName());
    }
View Full Code Here

    {
        int numberOfMessages = 1;
        long totalPayloadSize = PAYLOAD_SIZE_PER_MESSAGE * numberOfMessages;
        _command.setNumberOfMessages(numberOfMessages);

        ParticipantResult result = _consumerParticipant.doIt(CLIENT_NAME);

        assertExpectedConsumerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, _testStartTime,
                                      Session.CLIENT_ACKNOWLEDGE, null, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, null);

        _inOrder.verify(_delegate).consumeMessage(PARTICIPANT_NAME1, RECEIVE_TIMEOUT);
View Full Code Here

    public void testReceiveMessagesForDurationSynch() throws Exception
    {
        long duration = 100;
        _command.setMaximumDuration(duration);

        ParticipantResult result = _consumerParticipant.doIt(CLIENT_NAME);

        assertExpectedConsumerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, _testStartTime,
                                      Session.CLIENT_ACKNOWLEDGE, null, null, PAYLOAD_SIZE_PER_MESSAGE, null, duration);

        verify(_delegate, atLeastOnce()).consumeMessage(PARTICIPANT_NAME1, RECEIVE_TIMEOUT);
View Full Code Here

        final int batchSize = 3;
        long totalPayloadSize = PAYLOAD_SIZE_PER_MESSAGE * numberOfMessages;
        _command.setNumberOfMessages(numberOfMessages);
        _command.setBatchSize(batchSize);

        ParticipantResult result = _consumerParticipant.doIt(CLIENT_NAME);

        assertExpectedConsumerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, _testStartTime,
                                      Session.CLIENT_ACKNOWLEDGE, batchSize, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, null);

        verify(_delegate, times(numberOfMessages)).consumeMessage(PARTICIPANT_NAME1, RECEIVE_TIMEOUT);
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.