X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fit%2FNetconfITSecureTest.java;h=0c22a71c6b38e20b96da5163a26bed1a1b94e30b;hb=8582d8c0a0bde5aaaefc870ba77a33834d78a660;hp=9a4bc2aa5dee09092f7cf04412383d4f62d00dc1;hpb=d105455084f43d9423b7c0e6af785302e6a3ea93;p=controller.git diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java index 9a4bc2aa5d..0c22a71c6b 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java @@ -10,6 +10,8 @@ package org.opendaylight.controller.netconf.it; import com.google.common.base.Optional; import io.netty.channel.ChannelFuture; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.HashedWheelTimer; import org.junit.After; import org.junit.Before; @@ -51,6 +53,8 @@ public class NetconfITSecureTest extends AbstractConfigTest { private DefaultCommitNotificationProducer commitNot; private NetconfServerDispatcher dispatchS; + private EventLoopGroup nettyThreadgroup; + @Before public void setUp() throws Exception { @@ -62,6 +66,8 @@ public class NetconfITSecureTest extends AbstractConfigTest { commitNot = new DefaultCommitNotificationProducer(ManagementFactory.getPlatformMBeanServer()); + nettyThreadgroup = new NioEventLoopGroup(); + dispatchS = createDispatcher(Optional.of(getSslContext()), factoriesListener); ChannelFuture s = dispatchS.createServer(tlsAddress); s.await(); @@ -76,13 +82,15 @@ public class NetconfITSecureTest extends AbstractConfigTest { NetconfServerSessionListenerFactory listenerFactory = new NetconfServerSessionListenerFactory( factoriesListener, commitNot, idProvider); - return new NetconfServerDispatcher(sslC, serverNegotiatorFactory, listenerFactory); + NetconfServerDispatcher.ServerSslChannelInitializer serverChannelInitializer = new NetconfServerDispatcher.ServerSslChannelInitializer( + sslC, serverNegotiatorFactory, listenerFactory); + return new NetconfServerDispatcher(serverChannelInitializer, nettyThreadgroup, nettyThreadgroup); } @After public void tearDown() throws Exception { commitNot.close(); - dispatchS.close(); + nettyThreadgroup.shutdownGracefully(); } private SSLContext getSslContext() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, @@ -106,8 +114,8 @@ public class NetconfITSecureTest extends AbstractConfigTest { @Test public void testSecure() throws Exception { - try (NetconfClientDispatcher dispatch = new NetconfClientDispatcher(Optional.of(getSslContext())); - NetconfClient netconfClient = new NetconfClient("tls-client", tlsAddress, 4000, dispatch)) { + NetconfClientDispatcher dispatch = new NetconfClientDispatcher(Optional.of(getSslContext()), nettyThreadgroup, nettyThreadgroup); + try (NetconfClient netconfClient = new NetconfClient("tls-client", tlsAddress, 4000, dispatch)) { } }