Package org.apache.qpid.disttest.message

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


        ResultsDbWriter resultsDbWriter = new ResultsDbWriter(context, runId, _clock);
        resultsDbWriter.createResultsTableIfNecessary();

        resultsDbWriter.writeResults(results);

        ParticipantResult expectedResult = _resultsTestFixture.getFirstParticipantResult(results);
        assertResultsAreInDb(context, expectedResult, runId);
    }
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

        _command.setNumberOfMessages(numberOfMessages);

        when(_delegate.calculatePayloadSizeFrom(_mockMessage)).thenReturn(firstPayloadSize, secondPayloadSize, thirdPayloadSize);

        ParticipantResult result = _consumerParticipant.doIt(CLIENT_NAME);

        final int expectedPayloadResultPayloadSize = 0;
        final long totalPayloadSize = firstPayloadSize + secondPayloadSize + thirdPayloadSize;
        assertExpectedConsumerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, _testStartTime,
                                      Session.CLIENT_ACKNOWLEDGE, null, numberOfMessages, expectedPayloadResultPayloadSize, totalPayloadSize, null);
View Full Code Here

        int numberOfMessages = 1;
        long totalPayloadSize = PAYLOAD_SIZE_PER_MESSAGE * numberOfMessages;
        _command.setNumberOfMessages(numberOfMessages);
        _command.setEvaluateLatency(true);
        _consumerParticipant = new ConsumerParticipant(_delegate, _command);
        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

        verify(_participantRegistry).clear();
    }

    public void testResults() throws Exception
    {
        ParticipantResult testResult = mock(ParticipantResult.class);
        _client.sendResults(testResult);
        verify(_delegate).sendResponseMessage(testResult);
    }
View Full Code Here

    public void testRun()
    {
        _testInstance = createTestInstanceWithOneParticipant();
        _testRunner = new TestRunner(_participatingClients, _testInstance , _respondingJmsDelegate, COMMAND_RESPONSE_TIMEOUT, TEST_RESULT_TIMEOUT);

        ParticipantResult incomingParticipantResult = new ParticipantResult(PARTICIPANT_NAME);
        incomingParticipantResult.setRegisteredClientName(CLIENT1_REGISTERED_NAME);
        sendTestResultsLater(_testRunner, incomingParticipantResult);

        TestResult results = _testRunner.run();

        verify(_respondingJmsDelegate).addCommandListener(isA(TestRunner.TestCommandResponseListener.class));
        verify(_respondingJmsDelegate).addCommandListener(isA(TestRunner.ParticipantResultListener.class));

        verify(_respondingJmsDelegate).createQueues(isA(List.class));

        verify(_respondingJmsDelegate).sendCommandToClient(eq(CLIENT1_REGISTERED_NAME), isA(StartTestCommand.class));
        verify(_respondingJmsDelegate).sendCommandToClient(eq(CLIENT1_REGISTERED_NAME), isA(NoOpCommand.class));
        verify(_respondingJmsDelegate).sendCommandToClient(eq(CLIENT1_REGISTERED_NAME), isA(TearDownTestCommand.class));

        verify(_respondingJmsDelegate).deleteQueues(isA(List.class));

        verify(_respondingJmsDelegate).removeCommandListener(isA(TestRunner.ParticipantResultListener.class));
        verify(_respondingJmsDelegate).removeCommandListener(isA(TestRunner.TestCommandResponseListener.class));

        List<ParticipantResult> participantResults = results.getParticipantResults();
        assertEquals(1, participantResults.size());
        ParticipantResult resultingParticipantResult = participantResults.get(0);

        assertResultHasCorrectTestDetails(resultingParticipantResult);
    }
View Full Code Here

    private static final String PARTICIPANT = "PARTICIPANT";
    private static final String CONFIGURED_CLIENT1 = "CONFIGURED_CLIENT1";

    public ResultsForAllTests createResultsForAllTests()
    {
        ParticipantResult participantResult = mock(ParticipantResult.class);
        Map<ParticipantAttribute, Object> participantAttributes = getParticipantAttributes();

        when(participantResult.getAttributes()).thenReturn(participantAttributes);
        when(participantResult.getParticipantName()).thenReturn(PARTICIPANT);
        when(participantResult.getTestName()).thenReturn(TEST1);
        when(participantResult.getIterationNumber()).thenReturn(0);
        when(participantResult.getThroughput()).thenReturn(THROUGHPUT_VALUE);

        TestResult testResult = new TestResult(TEST1);
        testResult.addParticipantResult(participantResult);

        ResultsForAllTests resultsForAllTests = new ResultsForAllTests();
View Full Code Here

    public void testProducerPrecedesAllProducersResult()
    {
        assertCompare(
                new ProducerParticipantResult("participantName"),
                new ParticipantResult(TestResultAggregator.ALL_PRODUCER_PARTICIPANTS_NAME));
    }
View Full Code Here

    public void testConsumerPrecedesAllConsumersResult()
    {
        assertCompare(
                new ConsumerParticipantResult("participantName"),
                new ParticipantResult(TestResultAggregator.ALL_CONSUMER_PARTICIPANTS_NAME));
    }
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.