Package org.apache.qpid.disttest.message

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


        public boolean supports(Command command)
        {
            CommandType type = command.getType();
            if (type == CommandType.RESPONSE)
            {
                Response response = (Response)command;
                return _setOfResponsesToExpect.contains(response.getInReplyToCommandType());
            }
            return false;
        }
View Full Code Here


                try
                {
                    Command command = JmsMessageAdaptor.messageToCommand(message);
                    LOGGER.debug("Test client received " + command);
                    commandList.add(command);
                    producer.send(JmsMessageAdaptor.commandToMessage(_session, new Response(CLIENT1, command.getType())));
                }
                catch(Exception e)
                {
                    listenerException.set(e);
                }
View Full Code Here

        final RegisterClientCommand registrationCommand = _controllerQueue.getNext();
        createClientQueueProducer(registrationCommand);

        sendCommandToClient(new NoOpCommand());

        final Response responseCommand = _controllerQueue.getNext();
        assertEquals("Incorrect client message type", CommandType.RESPONSE, responseCommand.getType());
    }
View Full Code Here

        final Command stopClientCommand = new StopClientCommand();
        sendCommandToClient(stopClientCommand);

        _client.waitUntilStopped(1000);

        Response response = _controllerQueue.getNext();
        assertNotNull(response);
        assertFalse("response shouldn't contain error", response.hasError());

        assertEquals("Expected client to be in STOPPED state", ClientState.STOPPED, _client.getState());
    }
View Full Code Here

        final CreateConnectionCommand createConnectionCommand = new CreateConnectionCommand();
        createConnectionCommand.setConnectionName("newTestConnection");
        createConnectionCommand.setConnectionFactoryName("connectionfactory");

        sendCommandToClient(createConnectionCommand);
        Response response = _controllerQueue.getNext();

        assertFalse("Response message should not have indicated an error", response.hasError());
        assertEquals("Unexpected number of test connections", 1, _clientJmsDelegate.getNoOfTestConnections());
    }
View Full Code Here

        final CreateConnectionCommand createConnectionCommand = new CreateConnectionCommand();
        createConnectionCommand.setConnectionName("newTestConnection");
        createConnectionCommand.setConnectionFactoryName("connectionfactory");

        sendCommandToClient(createConnectionCommand);
        Response response = _controllerQueue.getNext();
        assertFalse("Response message should not have indicated an error", response.hasError());

        final CreateSessionCommand createSessionCommand = new CreateSessionCommand();
        createSessionCommand.setConnectionName("newTestConnection");
        createSessionCommand.setSessionName("newTestSession");
        createSessionCommand.setAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);

        sendCommandToClient(createSessionCommand);
        response = _controllerQueue.getNext();

        assertFalse("Response message should not have indicated an error", response.hasError());
        assertEquals("Unexpected number of test sessions", 1, _clientJmsDelegate.getNoOfTestSessions());
    }
View Full Code Here

        _controllerQueue.addNextResponse(responses);

        ParticipantResult results = (ParticipantResult) responses.get(expectedParticipantResultCommandType);
        validateResponse(null, results, true);

        Response startTestResponse = (Response) responses.get(CommandType.RESPONSE);
        validateResponse(CommandType.START_TEST, startTestResponse, true);
    }
View Full Code Here

    }

    private void sendCommandAndValidateResponse(final Command command, boolean shouldSucceed) throws Exception
    {
        sendCommandToClient(command);
        Response response = _controllerQueue.getNext();
        validateResponse(command.getType(), response, shouldSucceed);
    }
View Full Code Here

            @Override
            public Void answer(InvocationOnMock invocation) throws Throwable
            {
                final String clientName = (String)invocation.getArguments()[0];
                final Command command = (Command)invocation.getArguments()[1];
                _testRunner.processCommandResponse(new Response(clientName, command.getType()));
                return null;
            }
        }).when(_respondingJmsDelegate).sendCommandToClient(anyString(), isA(Command.class));
    }
View Full Code Here

            @Override
            public Void answer(InvocationOnMock invocation) throws Throwable
            {
                final String clientName = (String)invocation.getArguments()[0];
                final Command command = (Command)invocation.getArguments()[1];
                _controller.processStopClientResponse(new Response(clientName, command.getType()));
                return null;
            }
        }).when(_respondingJmsDelegate).sendCommandToClient(anyString(), isA(Command.class));
    }
View Full Code Here

TOP

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

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.