Search in sources :

Example 11 with Command

use of org.apache.qpid.disttest.message.Command in project qpid-broker-j by apache.

the class ConfigTestUtils method assertCommandForClient.

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()));
}
Also used : Command(org.apache.qpid.disttest.message.Command) CommandForClient(org.apache.qpid.disttest.controller.CommandForClient)

Aggregations

Command (org.apache.qpid.disttest.message.Command)11 DistributedTestException (org.apache.qpid.disttest.DistributedTestException)3 CommandForClient (org.apache.qpid.disttest.controller.CommandForClient)3 ConfigTestUtils.getCommand (org.apache.qpid.disttest.controller.config.ConfigTestUtils.getCommand)3 CreateConnectionCommand (org.apache.qpid.disttest.message.CreateConnectionCommand)3 CreateProducerCommand (org.apache.qpid.disttest.message.CreateProducerCommand)3 RegisterClientCommand (org.apache.qpid.disttest.message.RegisterClientCommand)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 JMSException (javax.jms.JMSException)2 CreateConsumerCommand (org.apache.qpid.disttest.message.CreateConsumerCommand)2 CreateSessionCommand (org.apache.qpid.disttest.message.CreateSessionCommand)2 NoOpCommand (org.apache.qpid.disttest.message.NoOpCommand)2 Response (org.apache.qpid.disttest.message.Response)2 StopClientCommand (org.apache.qpid.disttest.message.StopClientCommand)2 HashMap (java.util.HashMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Message (javax.jms.Message)1 MessageConsumer (javax.jms.MessageConsumer)1 MessageListener (javax.jms.MessageListener)1