From: Tomas Cere Date: Tue, 29 Mar 2016 12:12:33 +0000 (+0000) Subject: Merge "change to static function" X-Git-Tag: release/boron~163 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=a1be400609994146d8a2b23ec3b3b89e59619ea3;hp=3062d9b5a6704075b4b10a8e1ad481738ca370c7;p=netconf.git Merge "change to static function" --- diff --git a/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TestingNetconfClient.java b/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TestingNetconfClient.java index 131bea9671..dabe11a3ed 100644 --- a/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TestingNetconfClient.java +++ b/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/TestingNetconfClient.java @@ -25,12 +25,12 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler; -import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.LoginPassword; import org.opendaylight.netconf.api.NetconfMessage; import org.opendaylight.netconf.client.conf.NetconfClientConfiguration; import org.opendaylight.netconf.client.conf.NetconfClientConfiguration.NetconfClientProtocol; import org.opendaylight.netconf.client.conf.NetconfClientConfigurationBuilder; +import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler; +import org.opendaylight.netconf.nettyutil.handler.ssh.authentication.LoginPassword; import org.opendaylight.protocol.framework.NeverReconnectStrategy; @@ -47,21 +47,21 @@ public class TestingNetconfClient implements Closeable { private final long sessionId; public TestingNetconfClient(String clientLabel, - NetconfClientDispatcher netconfClientDispatcher, final NetconfClientConfiguration config) throws InterruptedException { + NetconfClientDispatcher netconfClientDispatcher, final NetconfClientConfiguration config) throws InterruptedException { this.label = clientLabel; sessionListener = config.getSessionListener(); Future clientFuture = netconfClientDispatcher.createClient(config); - clientSession = get(clientFuture);//TODO: make static + clientSession = get(clientFuture); this.sessionId = clientSession.getSessionId(); } - private NetconfClientSession get(Future clientFuture) throws InterruptedException { + private static NetconfClientSession get(Future clientFuture) throws InterruptedException { try { return clientFuture.get(); } catch (CancellationException e) { - throw new RuntimeException("Cancelling " + this, e); + throw new RuntimeException("Cancelling " + TestingNetconfClient.class.getSimpleName(), e); } catch (ExecutionException e) { - throw new IllegalStateException("Unable to create " + this, e); + throw new IllegalStateException("Unable to create " + TestingNetconfClient.class.getSimpleName(), e); } }