Search in sources :

Example 1 with CreateSessionCommand

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

the class SessionConfigTest method testCreateCommandsForSessionAndChildren.

@Test
public void testCreateCommandsForSessionAndChildren() {
    SessionConfig sessionConfig = createSessionConfigWithChildCommands();
    List<Command> commands = sessionConfig.createCommands(CONNECTION_NAME);
    assertEquals((long) 3, (long) commands.size());
    assertCommandEquals(commands, 0, CreateSessionCommand.class);
    assertCommandEquals(commands, 1, CreateProducerCommand.class);
    assertCommandEquals(commands, 2, CreateConsumerCommand.class);
    CreateSessionCommand createSessionCommand = getCommand(commands, 0);
    assertEquals((long) Session.AUTO_ACKNOWLEDGE, (long) createSessionCommand.getAcknowledgeMode());
    assertEquals(SESSION, createSessionCommand.getSessionName());
    assertEquals(CONNECTION_NAME, createSessionCommand.getConnectionName());
}
Also used : ConfigTestUtils.getCommand(org.apache.qpid.disttest.controller.config.ConfigTestUtils.getCommand) CreateConsumerCommand(org.apache.qpid.disttest.message.CreateConsumerCommand) CreateProducerCommand(org.apache.qpid.disttest.message.CreateProducerCommand) Command(org.apache.qpid.disttest.message.Command) CreateSessionCommand(org.apache.qpid.disttest.message.CreateSessionCommand) CreateSessionCommand(org.apache.qpid.disttest.message.CreateSessionCommand) Test(org.junit.Test)

Example 2 with CreateSessionCommand

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

the class SessionConfig method createCommand.

private CreateSessionCommand createCommand(String connectionName) {
    CreateSessionCommand command = new CreateSessionCommand();
    command.setAcknowledgeMode(_acknowledgeMode);
    command.setConnectionName(connectionName);
    command.setSessionName(_sessionName);
    return command;
}
Also used : CreateSessionCommand(org.apache.qpid.disttest.message.CreateSessionCommand)

Example 3 with CreateSessionCommand

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

the class ClientCommandVisitorTest method testCreateSession.

@Test
public void testCreateSession() throws Exception {
    final CreateSessionCommand command = new CreateSessionCommand();
    _visitor.visit(command);
    verify(_delegate).createSession(command);
}
Also used : CreateSessionCommand(org.apache.qpid.disttest.message.CreateSessionCommand) Test(org.junit.Test)

Aggregations

CreateSessionCommand (org.apache.qpid.disttest.message.CreateSessionCommand)3 Test (org.junit.Test)2 ConfigTestUtils.getCommand (org.apache.qpid.disttest.controller.config.ConfigTestUtils.getCommand)1 Command (org.apache.qpid.disttest.message.Command)1 CreateConsumerCommand (org.apache.qpid.disttest.message.CreateConsumerCommand)1 CreateProducerCommand (org.apache.qpid.disttest.message.CreateProducerCommand)1