X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnetty%2FSSHTest.java;h=d7d8660ae49149923cf60ada5b236dff745f9aed;hp=2802488170ef9cc9ef6d27b3846592b19219ca9b;hb=8eaba1eb027b02f8b36480721055dc99c6700e85;hpb=462f9ceb7da71750eead2a15f47e6229980954ad diff --git a/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java b/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java index 2802488170..d7d8660ae4 100644 --- a/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java +++ b/opendaylight/netconf/netconf-ssh/src/test/java/org/opendaylight/controller/netconf/netty/SSHTest.java @@ -61,7 +61,7 @@ public class SSHTest { @AfterClass public static void tearDown() throws Exception { hashedWheelTimer.stop(); - nettyGroup.shutdownGracefully().await(); + nettyGroup.shutdownGracefully().await(5, TimeUnit.SECONDS); minaTimerEx.shutdownNow(); nioExec.shutdownNow(); } @@ -84,7 +84,7 @@ public class SSHTest { final EchoClientHandler echoClientHandler = connectClient(addr); - Stopwatch stopwatch = new Stopwatch().start(); + Stopwatch stopwatch = Stopwatch.createStarted(); while(echoClientHandler.isConnected() == false && stopwatch.elapsed(TimeUnit.SECONDS) < 30) { Thread.sleep(500); } @@ -131,12 +131,12 @@ public class SSHTest { public void testClientWithoutServer() throws Exception { final InetSocketAddress address = new InetSocketAddress(12345); final EchoClientHandler echoClientHandler = connectClient(address); - final Stopwatch stopwatch = new Stopwatch().start(); + final Stopwatch stopwatch = Stopwatch.createStarted(); while(echoClientHandler.getState() == State.CONNECTING && stopwatch.elapsed(TimeUnit.SECONDS) < 5) { Thread.sleep(100); } assertFalse(echoClientHandler.isConnected()); - assertEquals(State.CONNECTION_CLOSED, echoClientHandler.getState()); + assertEquals(State.FAILED_TO_CONNECT, echoClientHandler.getState()); } }