Package org.apache.qpid.disttest.message

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


        {
            @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

    {
        Collection<String> registeredClients = _clientRegistry.getClients();

        LOGGER.info("Stopping all clients");
        _stopClientsResponseLatch = new CountDownLatch(registeredClients.size());
        Command command = new StopClientCommand();
        for (final String clientName : registeredClients)
        {
            _jmsDelegate.sendCommandToClient(clientName, command);
        }
View Full Code Here

{
    public static <C extends Command> void assertCommandForClient(final List<CommandForClient> commandsForClients, final int index, final String expectedRegisteredClientName, final Class<C> expectedCommandClass)
    {
        final CommandForClient commandForClient = commandsForClients.get(index);
        assertEquals(expectedRegisteredClientName, commandForClient.getClientName());
        final Command command = commandForClient.getCommand();
        assertTrue("Command " + index + " is of class " + command.getClass() + " but expecting " + expectedCommandClass,
                expectedCommandClass.isAssignableFrom(command.getClass()));
    }
View Full Code Here

        for (CommandForClient commandForClient : commandsForAllClients)
        {
            String configuredClientName = commandForClient.getClientName();
            String registeredClientName = _participatingClients.getRegisteredNameFromConfiguredName(configuredClientName);

            Command command = commandForClient.getCommand();

            LOGGER.debug("Sending command : {} ", command);

            sendCommandInternal(registeredClientName, command);
        }
View Full Code Here

                    try
                    {
                        String jmsMessageID = message.getJMSMessageID();
                        LOGGER.debug("Received message " + jmsMessageID);

                        final Command command = JmsMessageAdaptor.messageToCommand(message);
                        LOGGER.debug("Converted message " + jmsMessageID + " into command: " + command);

                        processCommandWithFirstSupportingListener(command);
                        LOGGER.debug("Finished processing command for message " + jmsMessageID);
                    }
View Full Code Here

        return jmsMessage;
    }

    public static Command messageToCommand(final Message jmsMessage)
    {
        Command command = null;
        try
        {
            final CommandType commandType = CommandType.valueOf(jmsMessage
                            .getStringProperty(DistributedTestConstants.MSG_COMMAND_PROPERTY));
            final JsonHandler jsonHandler = new JsonHandler();
View Full Code Here

        List<CommandForClient> newCommands = new ArrayList<CommandForClient>(commands.size());

        for (CommandForClient commandForClient : commands)
        {
            String clientName = commandForClient.getClientName();
            Command command = commandForClient.getCommand();

            _iterationValue.applyToCommand(command);

            newCommands.add(new CommandForClient(clientName, command));
        }
View Full Code Here

        }
    }

    public void sendRegistrationMessage()
    {
        Command command;
        try
        {
            command = new RegisterClientCommand(_clientName, _instructionQueue.getQueueName());
        }
        catch (final JMSException e)
View Full Code Here

    {
        List<CommandForClient> commandsForClient = new ArrayList<CommandForClient>();

        for (MessageProviderConfig messageProvider : _messageProviders)
        {
            Command command = messageProvider.createCommand();
            commandsForClient.add(new CommandForClient(_name, command));
        }
        for (ConnectionConfig connection : _connections)
        {
            List<Command> commands = connection.createCommands();
View Full Code Here

TOP

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

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.