use of org.apache.activemq.artemis.cli.commands.queue.DeleteQueue in project activemq-artemis by apache.
the class QueueCommandTest method testAutoDeleteAddress.
@Test
public void testAutoDeleteAddress() 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());
assertNotNull(server.getAddressInfo(queueName));
server.locateQueue(queueName).addConsumer(new DummyServerConsumer());
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.setRemoveConsumers(true);
delete.setAutoDeleteAddress(true);
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(command);
assertNull(server.getAddressInfo(queueName));
}
use of org.apache.activemq.artemis.cli.commands.queue.DeleteQueue in project activemq-artemis by apache.
the class QueueCommandTest method testDeleteQueueWithConsumersFails.
@Test
public void testDeleteQueueWithConsumersFails() 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.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(delete, "AMQ119025");
}
use of org.apache.activemq.artemis.cli.commands.queue.DeleteQueue 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.DeleteQueue in project activemq-artemis by apache.
the class QueueCommandTest method testDeleteQueueDoesNotExist.
@Test
public void testDeleteQueueDoesNotExist() throws Exception {
SimpleString queueName = new SimpleString("deleteQueue");
DeleteQueue delete = new DeleteQueue();
delete.setName(queueName.toString());
delete.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(delete, "AMQ119017");
assertFalse(server.queueQuery(queueName).isExists());
}
use of org.apache.activemq.artemis.cli.commands.queue.DeleteQueue 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);
}
Aggregations