Additional checkstyle fixes. Checkstyle validation fail enabled 11/12911/7
authorMarian Dubai <mdubai@cisco.com>
Tue, 18 Nov 2014 11:53:01 +0000 (12:53 +0100)
committerMarian Dubai <mdubai@cisco.com>
Tue, 9 Dec 2014 12:04:48 +0000 (13:04 +0100)
Change-Id: Ie6052a2ed10e2964f3da56f1832a797e700dc2f6
Signed-off-by: Marian Dubai <mdubai@cisco.com>
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java
opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java
opendaylight/netconf/pom.xml

index 3c4213cbc381b62d70ac073937e89dfaebbdde5e..6ed2861b8532a83ed639e3d2300ffb835db2647c 100644 (file)
@@ -32,30 +32,30 @@ public class RuntimeRpcElementResolvedTest {
     @Parameterized.Parameters(name = "{index}: parsed({0}) contains moduleName:{1} and instanceName:{2}")
     public static Collection<Object[]> data() {
         return Arrays.asList(new Object[][] {
     @Parameterized.Parameters(name = "{index}: parsed({0}) contains moduleName:{1} and instanceName:{2}")
     public static Collection<Object[]> data() {
         return Arrays.asList(new Object[][] {
-                // With namespaces
-                { "/a:modules/a:module[a:name='instanceName'][a:type='moduleType']/b:listener-state[b:peer-id='127.0.0.1']",
-                        new HashMap<>(ImmutableMap.of("listener-state", "127.0.0.1"))},
-                { "/a:modules/a:module[a:name='instanceName'][a:type='moduleType']",
-                        null},
+            // With namespaces
+            { "/a:modules/a:module[a:name='instanceName'][a:type='moduleType']/b:listener-state[b:peer-id='127.0.0.1']",
+                new HashMap<>(ImmutableMap.of("listener-state", "127.0.0.1"))},
+            { "/a:modules/a:module[a:name='instanceName'][a:type='moduleType']",
+                null},
 
 
-                // Without namespaces
-                { "/modules/module[name=instanceName][type=moduleType]", null},
-                { "/modules/module[type=moduleType][name='instanceName']", null},
-                { "/modules/module[name=\'instanceName\'][type=\"moduleType\"]", null},
-                { "/modules/module[type=moduleType and name=instanceName]", null},
-                { "/modules/module[name=\"instanceName\" and type=moduleType]", null},
-                { "/modules/module[type=\"moduleType\" and name=instanceName]", null},
-                { "/modules/module[name=\'instanceName\' and type=\"moduleType\"]", null},
+            // Without namespaces
+            { "/modules/module[name=instanceName][type=moduleType]", null},
+            { "/modules/module[type=moduleType][name='instanceName']", null},
+            { "/modules/module[name=\'instanceName\'][type=\"moduleType\"]", null},
+            { "/modules/module[type=moduleType and name=instanceName]", null},
+            { "/modules/module[name=\"instanceName\" and type=moduleType]", null},
+            { "/modules/module[type=\"moduleType\" and name=instanceName]", null},
+            { "/modules/module[name=\'instanceName\' and type=\"moduleType\"]", null},
 
 
-                // With inner beans
-                { "/modules/module[name=instanceName and type=\"moduleType\"]/inner[key=b]", Collections.singletonMap("inner", "b")},
-                { "/modules/module[name=instanceName and type=moduleType]/inner[key=b]", Collections.singletonMap("inner", "b")},
-                { "/modules/module[name=instanceName and type=moduleType]/inner[key=\'b\']", Collections.singletonMap("inner", "b")},
-                { "/modules/module[name=instanceName and type=moduleType]/inner[key=\"b\"]", Collections.singletonMap("inner", "b")},
+            // With inner beans
+            { "/modules/module[name=instanceName and type=\"moduleType\"]/inner[key=b]", Collections.singletonMap("inner", "b")},
+            { "/modules/module[name=instanceName and type=moduleType]/inner[key=b]", Collections.singletonMap("inner", "b")},
+            { "/modules/module[name=instanceName and type=moduleType]/inner[key=\'b\']", Collections.singletonMap("inner", "b")},
+            { "/modules/module[name=instanceName and type=moduleType]/inner[key=\"b\"]", Collections.singletonMap("inner", "b")},
 
 
-                { "/modules/module[name=instanceName and type=\"moduleType\"]/inner[key2=a]/inner2[key=b]",
-                        new HashMap<>(ImmutableMap.of("inner", "a", "inner2", "b"))
-                },
+            { "/modules/module[name=instanceName and type=\"moduleType\"]/inner[key2=a]/inner2[key=b]",
+                new HashMap<>(ImmutableMap.of("inner", "a", "inner2", "b"))
+            },
         });
     }
 
         });
     }
 
index 03bf4e3b328408de2ebb0beb923419ab4e623a26..413aa5cc6787cb77e28e9274b1d51d8a3ebd012a 100644 (file)
@@ -20,9 +20,9 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Map;
 import java.util.Set;
 import java.util.Date;
 import java.util.Map;
 import java.util.Set;
+import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.Assert;
 import org.junit.Test;
-import org.hamcrest.CoreMatchers;
 import org.opendaylight.controller.config.api.LookupRegistry;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.controller.config.api.LookupRegistry;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.yangtools.yang.common.QName;
index 2f72ad4d4769964021c0cc5f443692c4993ec0aa..0dd79e2723c32034df26c79583c83bdbe117a793 100644 (file)
@@ -30,7 +30,7 @@ public class NetconfServerSessionNegotiator
         AbstractNetconfSessionNegotiator<NetconfServerSessionPreferences, NetconfServerSession, NetconfServerSessionListener> {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class);
         AbstractNetconfSessionNegotiator<NetconfServerSessionPreferences, NetconfServerSession, NetconfServerSessionListener> {
 
     private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class);
-    
+
     private static final String UNKNOWN = "unknown";
 
     protected NetconfServerSessionNegotiator(
     private static final String UNKNOWN = "unknown";
 
     protected NetconfServerSessionNegotiator(
index c16046c64236b098bb3f98e9353db89e796abd00..c5d5bede367da93dd7f64a5c44fb278ed2029431 100644 (file)
@@ -1,14 +1,13 @@
 package org.opendaylight.controller.netconf.impl;
 
 package org.opendaylight.controller.netconf.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.local.LocalAddress;
+import java.net.InetSocketAddress;
 import org.apache.sshd.common.SshdSocketAddress;
 import org.junit.Test;
 
 import org.apache.sshd.common.SshdSocketAddress;
 import org.junit.Test;
 
-import java.net.InetSocketAddress;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 public class NetconfServerSessionNegotiatorTest {
 
     @Test
 public class NetconfServerSessionNegotiatorTest {
 
     @Test
index fdc9a020065be13d5de4268abcfe65c35117a206..5f316d11c1cc6e28210d3382d0a78ca23aa01dd6 100644 (file)
@@ -25,7 +25,6 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.concurrent.GlobalEventExecutor;
 import io.netty.channel.local.LocalAddress;
 import io.netty.channel.nio.NioEventLoopGroup;
 import io.netty.util.concurrent.GlobalEventExecutor;
-import java.io.File;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.nio.file.Files;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.nio.file.Files;
@@ -78,7 +77,6 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest {
     public static final String USERNAME = "user";
     public static final String PASSWORD = "pwd";
 
     public static final String USERNAME = "user";
     public static final String PASSWORD = "pwd";
 
-    private File sshKeyPair;
     private SshProxyServer sshProxyServer;
 
     private ExecutorService nioExec;
     private SshProxyServer sshProxyServer;
 
     private ExecutorService nioExec;
@@ -87,8 +85,6 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest {
 
     @Before
     public void setUp() throws Exception {
 
     @Before
     public void setUp() throws Exception {
-        sshKeyPair = Files.createTempFile("sshKeyPair", ".pem").toFile();
-        sshKeyPair.deleteOnExit();
         nioExec = Executors.newFixedThreadPool(1);
         clientGroup = new NioEventLoopGroup();
         minaTimerEx = Executors.newScheduledThreadPool(1);
         nioExec = Executors.newFixedThreadPool(1);
         clientGroup = new NioEventLoopGroup();
         minaTimerEx = Executors.newScheduledThreadPool(1);
@@ -98,12 +94,13 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest {
                         .setBindingAddress(TLS_ADDRESS)
                         .setLocalAddress(NetconfConfigUtil.getNetconfLocalAddress())
                         .setAuthenticator(new PasswordAuthenticator() {
                         .setBindingAddress(TLS_ADDRESS)
                         .setLocalAddress(NetconfConfigUtil.getNetconfLocalAddress())
                         .setAuthenticator(new PasswordAuthenticator() {
-            @Override
-            public boolean authenticate(final String username, final String password, final ServerSession session) {
-                return true;
-            }
-        })
-                        .setKeyPairProvider(new PEMGeneratorHostKeyProvider(sshKeyPair.toPath().toAbsolutePath().toString()))
+                            @Override
+                            public boolean authenticate(final String username, final String password, final ServerSession session) {
+                                return true;
+                            }
+                        }
+                    )
+                        .setKeyPairProvider(new PEMGeneratorHostKeyProvider(Files.createTempFile("prefix", "suffix").toAbsolutePath().toString()))
                         .setIdleTimeout(Integer.MAX_VALUE)
                         .createSshProxyServerConfiguration());
     }
                         .setIdleTimeout(Integer.MAX_VALUE)
                         .createSshProxyServerConfiguration());
     }
index dc175c57337205c27f76b03cd55c8af9ecf774fd..007dfdc1e7576aad45830d3e0089c6964409e420 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.controller.netconf.util;
 
  */
 package org.opendaylight.controller.netconf.util;
 
+import static org.hamcrest.CoreMatchers.containsString;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
-import static org.hamcrest.CoreMatchers.containsString;
 
 import org.junit.Test;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 
 import org.junit.Test;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
index 8b14adf252aff560b3473b1c8054fbf4f7f029f3..e1aa6ce3ed8184d979682df63281fe41311004e4 100644 (file)
         <artifactId>maven-checkstyle-plugin</artifactId>
         <configuration>
           <failsOnError>false</failsOnError>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <configuration>
           <failsOnError>false</failsOnError>
-          <failOnViolation>false</failOnViolation>
+          <failOnViolation>true</failOnViolation>
           <configLocation>checkstyle-logging.xml</configLocation>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <configLocation>checkstyle-logging.xml</configLocation>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>