ARTEMIS-2967 Adding testSimpleConnect back and fixing a possible NPE

This commit is contained in:
Clebert Suconic 2020-10-29 22:01:01 -04:00
parent caddd4fb2f
commit 480197975b
2 changed files with 16 additions and 3 deletions

View File

@ -154,9 +154,11 @@ public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener,
server.getConfiguration().registerBrokerPlugin(this);
try {
for (AMQPBrokerConnectionElement connectionElement : brokerConnectConfiguration.getConnectionElements()) {
if (connectionElement.getType() == AMQPBrokerConnectionAddressType.MIRROR) {
installMirrorController((AMQPMirrorBrokerConnectionElement)connectionElement, server);
if (brokerConnectConfiguration != null && brokerConnectConfiguration.getConnectionElements() != null) {
for (AMQPBrokerConnectionElement connectionElement : brokerConnectConfiguration.getConnectionElements()) {
if (connectionElement.getType() == AMQPBrokerConnectionAddressType.MIRROR) {
installMirrorController((AMQPMirrorBrokerConnectionElement) connectionElement, server);
}
}
}
} catch (Throwable e) {

View File

@ -54,6 +54,17 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
return createServer(AMQP_PORT, false);
}
@Test
public void testsSimpleConnect() throws Exception {
server.start();
server_2 = createServer(AMQP_PORT_2, false);
AMQPBrokerConnectConfiguration amqpConnection = new AMQPBrokerConnectConfiguration("test", "tcp://localhost:" + AMQP_PORT);
server_2.getConfiguration().addAMQPConnection(amqpConnection);
server_2.start();
}
@Test
public void testSimpleTransferPush() throws Exception {
internalTransferPush("TEST", false);