Set<ContainerProxy> containers = ContainerBuilder.create(fabricProxy, 2).withName("child").withProfiles("default").assertProvisioningResult().build();
try {
LinkedList<Container> containerList = new LinkedList<Container>(containers);
Container broker = containerList.removeLast();
Profile brokerProfile = broker.getVersion().getRequiredProfile("mq-broker-default.mq");
broker.setProfiles(new Profile[]{brokerProfile});
Provision.provisioningSuccess(Arrays.asList(broker), PROVISION_TIMEOUT);
waitForBroker("default");
final BrokerViewMBean bean = (BrokerViewMBean)Provision.getMBean(broker, new ObjectName("org.apache.activemq:type=Broker,brokerName=mq"), BrokerViewMBean.class, 120000);
Assert.assertNotNull("Cannot get BrokerViewMBean from JMX", bean);
System.out.println(executeCommand("container-list"));
for (Container c : containerList) {
Profile exampleProfile = broker.getVersion().getRequiredProfile("example-mq");
c.setProfiles(new Profile[]{exampleProfile});
}
Provision.provisioningSuccess(containers, PROVISION_TIMEOUT);