use of org.apache.activemq.network.NetworkConnector in project tomee by apache.
the class ActiveMQ5FactoryTest method duplex.
@Test
public void duplex() throws Exception {
final int port = getNextAvailablePort();
for (final boolean b : asList(true, false)) {
// broker:(tcp://localhost:${port})?networkConnectorURIs=static%3A%2F%2Ftcp%3A%2F%2Flocalhost%3A${port}%3Fduplex%3Dtrue
final URI brokerURI = new URI("amq5factory:broker:(tcp://localhost:" + port + ")?" + "networkConnectorURIs=" + URLEncoder.encode("static://tcp://localhost:" + port + "?duplex=" + b, "UTF-8"));
final BrokerService bs = new ActiveMQ5Factory().createBroker(brokerURI);
bs.stop();
ActiveMQ5Factory.brokers.remove(brokerURI);
final NetworkConnector nc = bs.getNetworkConnectors().iterator().next();
assertEquals("duplex is " + b, b, nc.isDuplex());
}
}
Aggregations