Fix checkstyle warnings in netconf-client 57/12857/6
authorMarian Dubai <mdubai@cisco.com>
Fri, 14 Nov 2014 14:25:45 +0000 (15:25 +0100)
committerMarian Dubai <mdubai@cisco.com>
Fri, 21 Nov 2014 10:46:51 +0000 (10:46 +0000)
Change-Id: I94d8c31a16f0755451a3bebad5a8792a97d426d2
Signed-off-by: Marian Dubai <mdubai@cisco.com>
15 files changed:
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcherImpl.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSession.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactory.java
opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListener.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientConfigurationTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientDispatcherImplTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorFactoryTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfReconnectingClientConfigurationTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/TcpClientChannelInitializerTest.java
opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/TestingNetconfClient.java

index bdebfa2..5d584f3 100644 (file)
@@ -8,24 +8,22 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.util.Timer;
+import io.netty.util.concurrent.Future;
+import io.netty.util.concurrent.Promise;
 import java.io.Closeable;
-
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.protocol.framework.AbstractDispatcher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.util.Timer;
-import io.netty.util.concurrent.Future;
-import io.netty.util.concurrent.Promise;
-
 public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClientSession, NetconfClientSessionListener>
         implements NetconfClientDispatcher, Closeable {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientDispatcherImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientDispatcherImpl.class);
 
     private final Timer timer;
 
@@ -48,14 +46,17 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     @Override
     public Future<Void> createReconnectingClient(final NetconfReconnectingClientConfiguration clientConfiguration) {
         switch (clientConfiguration.getProtocol()) {
-            case TCP: return createReconnectingTcpClient(clientConfiguration);
-            case SSH: return createReconnectingSshClient(clientConfiguration);
-            default: throw new IllegalArgumentException("Unknown client protocol " + clientConfiguration.getProtocol());
+        case TCP:
+            return createReconnectingTcpClient(clientConfiguration);
+        case SSH:
+            return createReconnectingSshClient(clientConfiguration);
+        default:
+            throw new IllegalArgumentException("Unknown client protocol " + clientConfiguration.getProtocol());
         }
     }
 
     private Future<NetconfClientSession> createTcpClient(final NetconfClientConfiguration currentConfiguration) {
-        logger.debug("Creating TCP client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating TCP client with configuration: {}", currentConfiguration);
         return super.createClient(currentConfiguration.getAddress(), currentConfiguration.getReconnectStrategy(),
                 new PipelineInitializer<NetconfClientSession>() {
 
@@ -72,7 +73,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<Void> createReconnectingTcpClient(final NetconfReconnectingClientConfiguration currentConfiguration) {
-        logger.debug("Creating reconnecting TCP client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating reconnecting TCP client with configuration: {}", currentConfiguration);
         final TcpClientChannelInitializer init = new TcpClientChannelInitializer(getNegotiatorFactory(currentConfiguration),
                 currentConfiguration.getSessionListener());
 
@@ -86,7 +87,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<NetconfClientSession> createSshClient(final NetconfClientConfiguration currentConfiguration) {
-        logger.debug("Creating SSH client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating SSH client with configuration: {}", currentConfiguration);
         return super.createClient(currentConfiguration.getAddress(), currentConfiguration.getReconnectStrategy(),
                 new PipelineInitializer<NetconfClientSession>() {
 
@@ -102,7 +103,7 @@ public class NetconfClientDispatcherImpl extends AbstractDispatcher<NetconfClien
     }
 
     private Future<Void> createReconnectingSshClient(final NetconfReconnectingClientConfiguration currentConfiguration) {
-        logger.debug("Creating reconnecting SSH client with configuration: {}", currentConfiguration);
+        LOG.debug("Creating reconnecting SSH client with configuration: {}", currentConfiguration);
         final SshClientChannelInitializer init = new SshClientChannelInitializer(currentConfiguration.getAuthHandler(),
                 getNegotiatorFactory(currentConfiguration), currentConfiguration.getSessionListener());
 
index bd91af5..732b8fa 100644 (file)
@@ -9,9 +9,7 @@
 package org.opendaylight.controller.netconf.client;
 
 import io.netty.channel.Channel;
-
 import java.util.Collection;
-
 import org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXICodec;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXIToMessageDecoder;
@@ -23,7 +21,7 @@ import org.slf4j.LoggerFactory;
 
 public class NetconfClientSession extends AbstractNetconfSession<NetconfClientSession, NetconfClientSessionListener> {
 
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSession.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSession.class);
     private final Collection<String> capabilities;
 
     /**
@@ -38,7 +36,7 @@ public class NetconfClientSession extends AbstractNetconfSession<NetconfClientSe
             final Collection<String> capabilities) {
         super(sessionListener, channel, sessionId);
         this.capabilities = capabilities;
-        logger.debug("Client Session {} created", toString());
+        LOG.debug("Client Session {} created", toString());
     }
 
     public Collection<String> getServerCapabilities() {
index cbbee1f..a8c9a65 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
-
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelFutureListener;
@@ -18,12 +17,9 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
-
 import java.util.Collection;
-
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpression;
-
 import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
@@ -44,7 +40,7 @@ import org.w3c.dom.NodeList;
 public class NetconfClientSessionNegotiator extends
         AbstractNetconfSessionNegotiator<NetconfClientSessionPreferences, NetconfClientSession, NetconfClientSessionListener>
 {
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSessionNegotiator.class);
 
     private static final XPathExpression sessionIdXPath = XMLNetconfUtil
             .compileXPath("/netconf:hello/netconf:session-id");
@@ -68,12 +64,12 @@ public class NetconfClientSessionNegotiator extends
         // If exi should be used, try to initiate exi communication
         // Call negotiationSuccessFul after exi negotiation is finished successfully or not
         if (shouldUseExi(netconfMessage)) {
-            logger.debug("Netconf session {} should use exi.", session);
+            LOG.debug("Netconf session {} should use exi.", session);
             NetconfStartExiMessage startExiMessage = (NetconfStartExiMessage) sessionPreferences.getStartExiMessage();
             tryToInitiateExi(session, startExiMessage);
         } else {
             // Exi is not supported, release session immediately
-            logger.debug("Netconf session {} isn't capable of using exi.", session);
+            LOG.debug("Netconf session {} isn't capable of using exi.", session);
             negotiationSuccessful(session);
         }
     }
@@ -92,10 +88,10 @@ public class NetconfClientSessionNegotiator extends
             @Override
             public void operationComplete(final ChannelFuture f) {
                 if (!f.isSuccess()) {
-                    logger.warn("Failed to send start-exi message {} on session {}", startExiMessage, this, f.cause());
+                    LOG.warn("Failed to send start-exi message {} on session {}", startExiMessage, this, f.cause());
                     channel.pipeline().remove(ExiConfirmationInboundHandler.EXI_CONFIRMED_HANDLER);
                 } else {
-                    logger.trace("Start-exi message {} sent to socket on session {}", startExiMessage, this);
+                    LOG.trace("Start-exi message {} sent to socket on session {}", startExiMessage, this);
                 }
             }
         });
@@ -161,26 +157,26 @@ public class NetconfClientSessionNegotiator extends
 
             // Ok response to start-exi, try to add exi handlers
             if (NetconfMessageUtil.isOKMessage(netconfMessage)) {
-                logger.trace("Positive response on start-exi call received on session {}", session);
+                LOG.trace("Positive response on start-exi call received on session {}", session);
                 try {
                     session.startExiCommunication(startExiMessage);
                 } catch (RuntimeException e) {
                     // Unable to add exi, continue without exi
-                    logger.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e);
+                    LOG.warn("Unable to start exi communication, Communication will continue without exi on session {}", session, e);
                 }
 
                 // Error response
             } else if(NetconfMessageUtil.isErrorMessage(netconfMessage)) {
-                logger.warn(
+                LOG.warn(
                         "Error response to start-exi message {}, Communication will continue without exi on session {}",
                         XmlUtil.toString(netconfMessage.getDocument()), session);
 
                 // Unexpected response to start-exi, throwing message away, continue without exi
             } else {
-                logger.warn(
-                        "Unexpected response to start-exi message, should be ok, was {}, " +
-                                "Communication will continue without exi and response message will be thrown away on session {}",
-                        XmlUtil.toString(netconfMessage.getDocument()), session);
+                LOG.warn(
+                        "Unexpected response to start-exi message, should be ok, was {}, ",XmlUtil.toString(netconfMessage.getDocument()),
+                        "Communication will continue without exi and response message will be thrown away on session {}",
+                         session);
             }
 
             negotiationSuccessful(session);
index 3b1de34..7efb28b 100644 (file)
@@ -11,11 +11,9 @@ package org.opendaylight.controller.netconf.client;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
-
 import io.netty.channel.Channel;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
-
 import org.opendaylight.controller.netconf.api.NetconfClientSessionPreferences;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
@@ -45,7 +43,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
     private final long connectionTimeoutMillis;
     private final Timer timer;
     private final EXIOptions options;
-    private static final Logger logger = LoggerFactory.getLogger(NetconfClientSessionNegotiatorFactory.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetconfClientSessionNegotiatorFactory.class);
 
     public NetconfClientSessionNegotiatorFactory(Timer timer,
                                                  Optional<NetconfHelloMessageAdditionalHeader> additionalHeader,
@@ -72,7 +70,7 @@ public class NetconfClientSessionNegotiatorFactory implements SessionNegotiatorF
         try {
             helloMessage = NetconfHelloMessage.createClientHello(CLIENT_CAPABILITIES, additionalHeader);
         } catch (NetconfDocumentedException e) {
-            logger.error("Unable to create client hello message with capabilities {} and additional handler {}",CLIENT_CAPABILITIES,additionalHeader);
+            LOG.error("Unable to create client hello message with capabilities {} and additional handler {}",CLIENT_CAPABILITIES,additionalHeader);
             throw new IllegalStateException(e);
         }
 
index 524f0b5..77f8741 100644 (file)
@@ -8,22 +8,18 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import com.google.common.base.Preconditions;
 import io.netty.util.concurrent.Future;
 import io.netty.util.concurrent.GlobalEventExecutor;
 import io.netty.util.concurrent.Promise;
-
 import java.util.ArrayDeque;
 import java.util.Queue;
-
 import javax.annotation.concurrent.GuardedBy;
-
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.api.NetconfTerminationReason;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 public class SimpleNetconfClientSessionListener implements NetconfClientSessionListener {
     private static final class RequestEntry {
         private final Promise<NetconfMessage> promise;
@@ -35,7 +31,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
         }
     }
 
-    private static final Logger logger = LoggerFactory.getLogger(SimpleNetconfClientSessionListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SimpleNetconfClientSessionListener.class);
 
     @GuardedBy("this")
     private final Queue<RequestEntry> requests = new ArrayDeque<>();
@@ -48,12 +44,12 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
         while (!requests.isEmpty()) {
             final RequestEntry e = requests.peek();
             if (e.promise.setUncancellable()) {
-                logger.debug("Sending message {}", e.request);
+                LOG.debug("Sending message {}", e.request);
                 clientSession.sendMessage(e.request);
                 break;
             }
 
-            logger.debug("Message {} has been cancelled, skipping it", e.request);
+            LOG.debug("Message {} has been cancelled, skipping it", e.request);
             requests.poll();
         }
     }
@@ -61,7 +57,7 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
     @Override
     public final synchronized void onSessionUp(NetconfClientSession clientSession) {
         this.clientSession = Preconditions.checkNotNull(clientSession);
-        logger.debug("Client session {} went up", clientSession);
+        LOG.debug("Client session {} went up", clientSession);
         dispatchRequest();
     }
 
@@ -76,28 +72,28 @@ public class SimpleNetconfClientSessionListener implements NetconfClientSessionL
 
     @Override
     public final void onSessionDown(NetconfClientSession clientSession, Exception e) {
-        logger.debug("Client Session {} went down unexpectedly", clientSession, e);
+        LOG.debug("Client Session {} went down unexpectedly", clientSession, e);
         tearDown(e);
     }
 
     @Override
     public final void onSessionTerminated(NetconfClientSession clientSession,
             NetconfTerminationReason netconfTerminationReason) {
-        logger.debug("Client Session {} terminated, reason: {}", clientSession,
+        LOG.debug("Client Session {} terminated, reason: {}", clientSession,
                 netconfTerminationReason.getErrorMessage());
         tearDown(new RuntimeException(netconfTerminationReason.getErrorMessage()));
     }
 
     @Override
     public synchronized void onMessage(NetconfClientSession session, NetconfMessage message) {
-        logger.debug("New message arrived: {}", message);
+        LOG.debug("New message arrived: {}", message);
 
         final RequestEntry e = requests.poll();
         if (e != null) {
             e.promise.setSuccess(message);
             dispatchRequest();
         } else {
-            logger.info("Ignoring unsolicited message {}", message);
+            LOG.info("Ignoring unsolicited message {}", message);
         }
     }
 
index 592cdad..5fa2178 100644 (file)
@@ -9,19 +9,16 @@
 package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Optional;
+import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfigurationBuilder;
 import org.opendaylight.controller.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 
-import java.net.InetSocketAddress;
-
 public class NetconfClientConfigurationTest {
     @Test
     public void testNetconfClientConfiguration() throws Exception {
index dfbb972..ab25f96 100644 (file)
@@ -8,6 +8,10 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doReturn;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelPromise;
@@ -15,11 +19,10 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import io.netty.util.concurrent.GenericFutureListener;
+import java.net.InetSocketAddress;
+import java.util.concurrent.Future;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientDispatcherImpl;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
@@ -28,13 +31,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
-import java.net.InetSocketAddress;
-import java.util.concurrent.Future;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-
 public class NetconfClientDispatcherImplTest {
     @Test
     public void testNetconfClientDispatcherImpl() throws Exception {
index 62d6275..ecb14cc 100644 (file)
@@ -8,6 +8,10 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
 import io.netty.util.HashedWheelTimer;
@@ -17,9 +21,6 @@ import org.junit.Test;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
 
 public class NetconfClientSessionNegotiatorFactoryTest {
     @Test
index 187f13b..ce18ac0 100644 (file)
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.base.Optional;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -61,7 +62,6 @@ public class NetconfClientSessionNegotiatorTest {
         pipeline = mockChannelPipeline();
         future = mockChannelFuture();
         channel = mockChannel();
-        System.out.println("setup done");
     }
 
     private ChannelHandler mockChannelHandler() {
index 731a3fe..850ad55 100644 (file)
@@ -8,27 +8,24 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Lists;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
+import java.util.Collection;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.netconf.client.NetconfClientSession;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
 import org.opendaylight.controller.netconf.nettyutil.handler.NetconfEXICodec;
 import org.openexi.proc.common.EXIOptions;
 
-import java.util.Collection;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.mock;
-
 public class NetconfClientSessionTest {
 
     @Mock
index a975465..c74aa2b 100644 (file)
@@ -9,11 +9,10 @@
 package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Optional;
+import java.net.InetSocketAddress;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.opendaylight.controller.netconf.client.NetconfClientSessionListener;
-import org.opendaylight.controller.netconf.client.SimpleNetconfClientSessionListener;
 import org.opendaylight.controller.netconf.client.conf.NetconfClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfiguration;
 import org.opendaylight.controller.netconf.client.conf.NetconfReconnectingClientConfigurationBuilder;
@@ -22,8 +21,6 @@ import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessageAddi
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
 
-import java.net.InetSocketAddress;
-
 public class NetconfReconnectingClientConfigurationTest {
     @Test
     public void testNetconfReconnectingClientConfiguration() throws Exception {
index 9065ca4..8ce1ef0 100644 (file)
@@ -7,20 +7,25 @@
  */
 
 package org.opendaylight.controller.netconf.client;
-import io.netty.channel.*;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelFuture;
 import io.netty.util.concurrent.Future;
+import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.internal.util.collections.Sets;
 import org.opendaylight.controller.netconf.api.NetconfMessage;
 import org.opendaylight.controller.netconf.util.messages.NetconfHelloMessage;
 
-import java.util.Set;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.*;
-
 public class SimpleNetconfClientSessionListenerTest {
 
     private Channel channel;
index 8c55d8c..dc8fde6 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -17,10 +24,6 @@ import org.opendaylight.controller.netconf.nettyutil.handler.ssh.authentication.
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
 public class SshClientChannelInitializerTest {
     @Test
     public void test() throws Exception {
index 9c57565..210f898 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.client;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelPipeline;
@@ -16,8 +23,6 @@ import org.junit.Test;
 import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiator;
 
-import static org.mockito.Mockito.*;
-
 public class TcpClientChannelInitializerTest {
     @Test
     public void testInitializeSessionNegotiator() throws Exception {
index d7209d9..256dc30 100644 (file)
@@ -108,7 +108,7 @@ public class TestingNetconfClient implements Closeable {
         NetconfClientDispatcherImpl netconfClientDispatcher = new NetconfClientDispatcherImpl(nettyGroup, nettyGroup, hashedWheelTimer);
         LoginPassword authHandler = new LoginPassword("admin", "admin");
         TestingNetconfClient client = new TestingNetconfClient("client", netconfClientDispatcher, getClientConfig("127.0.0.1", 1830, true, Optional.of(authHandler)));
-        System.out.println(client.getCapabilities());
+        System.console().writer().println(client.getCapabilities());
     }
 
     private static NetconfClientConfiguration getClientConfig(String host ,int port, boolean ssh, Optional<? extends AuthenticationHandler> maybeAuthHandler) throws UnknownHostException {