use of org.apache.activemq.artemis.cli.commands.address.CreateAddress in project activemq-artemis by apache.
the class AddressCommandTest method testCreateAddressAlreadyExistsShowsError.
@Test
public void testCreateAddressAlreadyExistsShowsError() throws Exception {
String address = "address";
CreateAddress command = new CreateAddress();
command.setName(address);
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(command);
assertNotNull(server.getAddressInfo(new SimpleString(address)));
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionFailure(command, "Address already exists");
}
use of org.apache.activemq.artemis.cli.commands.address.CreateAddress 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.CreateAddress in project activemq-artemis by apache.
the class AddressCommandTest method testShowAddress.
@Test
public void testShowAddress() throws Exception {
String address = "address";
CreateAddress command = new CreateAddress();
command.setName(address);
command.execute(new ActionContext());
assertNotNull(server.getAddressInfo(new SimpleString(address)));
ShowAddress showAddress = new ShowAddress();
showAddress.setName(address);
showAddress.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
System.out.println(output.toString());
}
use of org.apache.activemq.artemis.cli.commands.address.CreateAddress in project activemq-artemis by apache.
the class AddressCommandTest method testCreateAddress.
@Test
public void testCreateAddress() throws Exception {
String address = "address";
CreateAddress command = new CreateAddress();
command.setName(address);
command.setAnycast(true);
command.setMulticast(true);
command.execute(new ActionContext(System.in, new PrintStream(output), new PrintStream(error)));
checkExecutionPassed(command);
AddressInfo addressInfo = server.getAddressInfo(new SimpleString(address));
assertNotNull(addressInfo);
assertTrue(addressInfo.getRoutingTypes().contains(RoutingType.ANYCAST));
assertTrue(addressInfo.getRoutingTypes().contains(RoutingType.MULTICAST));
}
Aggregations