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 bdebfa28cc36bf6d95c4f40b1e10512444cc6b5d..5d584f3b987f90ca65920a9befcb945616b1b8c7 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 bd91af5bcc95ba7f691d6880bbabe9483a865d2a..732b8fa1caa572e590ee090c2d04bec511bfd774 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 cbbee1f65508353b117bbd21db22b523b4244694..a8c9a6526ddde26b67b42b6c09fe738fd7484f87 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 3b1de348ff86858884d27a6436ddc0c0d62692fb..7efb28b4674e4fd592b169a2c7191c8f999f6585 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 524f0b52b7e22f4dc01317d5c7cf7dbcc1c045a0..77f8741a4f7c9e8bad4cc1971ce24b48cfe095a2 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 592cdad4c196bdc47fb24588fad630192da593fa..5fa217839d8bb01f0f504819a512a80f9913f9bc 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 dfbb972e8c8f90b5e6f3285fea974c6924ff4640..ab25f96088482810cec53d55dab697f95e4484c1 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 62d6275b9ef004440db7f6a075b114b476edb2c1..ecb14cc84dbd8f902e424be893984dc198082774 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 187f13b2585d9fda02fdc6de209e58cc92001ebd..ce18ac057944e4d6676a8a018083e5e1a224cfad 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 731a3fe9606197f6ecf95fea28944fc09b435b69..850ad55fc61314481cde821ff575bee9789a3f86 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 a9754654d5a7a4e1ee1e2588fb3a127bcc677d61..c74aa2bf15c3b7d8e6342cb0567b3a0810ab624b 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 9065ca45a290a4b761dc693caf6b17ca3723182d..8ce1ef0db501c1986d8f54d410ab305af4c7423e 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 8c55d8cc10eaadf1d01ad18391383013fcc68068..dc8fde6e2c615aa8a35958d7f805589b85e467cb 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 9c57565981d40069ee010458357c1f388879e8c6..210f898659f7980ea6a4a49d4078ef6fec7cc087 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 d7209d929514c6ddb2dcb835f5cc8273bea95ebc..256dc30a149b2e7b7af68f916c001e34f8a27ecd 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 {