use of org.apache.activemq.artemis.cli.commands.queue.CreateQueue in project activemq-artemis by apache.
the class QueueCommandTest method testDeleteCoreQueue.
@Test
public void testDeleteCoreQueue() throws Exception {
SimpleString queueName = new SimpleString("deleteQueue");
CreateQueue command = new CreateQueue();
command.setName(queueName.toString());
command.setFilter("color='green'");
command.setAutoCreateAddress(true);
command.setMulticast(true);
command.setAnycast(false);
command.execute(new ActionContext());
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(delete);
assertFalse(server.queueQuery(queueName).isExists());
}
use of org.apache.activemq.artemis.cli.commands.queue.CreateQueue in project activemq-artemis by apache.
the class QueueCommandTest method testDeleteQueueWithConsumersFailsAndRemoveConsumersTrue.
@Test
public void testDeleteQueueWithConsumersFailsAndRemoveConsumersTrue() throws Exception {
SimpleString queueName = new SimpleString("deleteQueue");
CreateQueue command = new CreateQueue();
command.setName(queueName.toString());
command.setFilter("color='green'");
command.setAutoCreateAddress(true);
command.setMulticast(true);
command.setAnycast(false);
command.execute(new ActionContext());
server.locateQueue(queueName).addConsumer(new DummyServerConsumer());
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.setRemoveConsumers(true);
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(command);
}
use of org.apache.activemq.artemis.cli.commands.queue.CreateQueue in project activemq-artemis by apache.
the class QueueCommandTest method testCreateCoreQueueAutoCreateAddressDefaultAddress.
@Test
public void testCreateCoreQueueAutoCreateAddressDefaultAddress() throws Exception {
String queueName = UUID.randomUUID().toString();
CreateQueue command = new CreateQueue();
command.setName(queueName);
command.setAutoCreateAddress(true);
command.setMulticast(true);
command.setAnycast(false);
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(command);
assertNotNull(server.getAddressInfo(new SimpleString(queueName)));
Queue queue = server.locateQueue(new SimpleString(queueName));
assertEquals(-1, queue.getMaxConsumers());
assertEquals(false, queue.isPurgeOnNoConsumers());
assertTrue(server.queueQuery(new SimpleString(queueName)).isExists());
}
use of org.apache.activemq.artemis.cli.commands.queue.CreateQueue in project activemq-artemis by apache.
the class QueueCommandTest method testCreateQueueAlreadyExists.
@Test
public void testCreateQueueAlreadyExists() throws Exception {
String queueName = "queue2";
String filerString = "color='green'";
CreateQueue command = new CreateQueue();
command.setName(queueName);
command.setFilter("color='green'");
command.setAutoCreateAddress(true);
command.setMulticast(true);
command.setAnycast(false);
command.execute(new ActionContext());
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(command, "AMQ119019");
}
Aggregations