use of org.apache.activemq.artemis.cli.commands.address.DeleteAddress in project activemq-artemis by apache.
the class AddressCommandTest method testDeleteAddressDoesNotExistsShowsError.
@Test
public void testDeleteAddressDoesNotExistsShowsError() throws Exception {
String address = "address";
DeleteAddress deleteAddress = new DeleteAddress();
deleteAddress.setName(address);
deleteAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(deleteAddress, "Address Does Not Exist");
}
use of org.apache.activemq.artemis.cli.commands.address.DeleteAddress in project activemq-artemis by apache.
the class AddressCommandTest method testDeleteAddress.
@Test
public void testDeleteAddress() throws Exception {
String address = "address";
CreateAddress command = new CreateAddress();
command.setName(address);
command.execute(new ActionContext());
assertNotNull(server.getAddressInfo(new SimpleString(address)));
DeleteAddress deleteAddress = new DeleteAddress();
deleteAddress.setName(address);
deleteAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(deleteAddress);
assertNull(server.getAddressInfo(new SimpleString(address)));
}
use of org.apache.activemq.artemis.cli.commands.address.DeleteAddress in project activemq-artemis by apache.
the class AddressCommandTest method testFailDeleteAddressWhenExistsQueues.
@Test
public void testFailDeleteAddressWhenExistsQueues() throws Exception {
final String addressName = "address";
final SimpleString addressSimpleString = new SimpleString(addressName);
final AddressInfo addressInfo = new AddressInfo(addressSimpleString, EnumSet.of(RoutingType.ANYCAST, RoutingType.MULTICAST));
server.addAddressInfo(addressInfo);
server.createQueue(addressSimpleString, RoutingType.MULTICAST, new SimpleString("queue1"), null, true, false);
final DeleteAddress deleteAddress = new DeleteAddress();
deleteAddress.setName(addressName);
deleteAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(deleteAddress, "Address " + addressName + " has bindings");
}
Aggregations