From: Tony Tkacik Date: Tue, 9 Dec 2014 15:46:13 +0000 (+0000) Subject: Merge "Fix checkstyle warnings in yang-jmx-generator-plugin" X-Git-Tag: release/lithium~784 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=304dec89fd7a13b42e821ca51b08bca93d7dc540;hp=69011f0833c2d383536c2ac61f2b0edc83d119e9 Merge "Fix checkstyle warnings in yang-jmx-generator-plugin" --- diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java index 3c4213cbc3..6ed2861b85 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java @@ -32,30 +32,30 @@ public class RuntimeRpcElementResolvedTest { @Parameterized.Parameters(name = "{index}: parsed({0}) contains moduleName:{1} and instanceName:{2}") public static Collection 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")) + }, }); } diff --git a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java index 03bf4e3b32..413aa5cc67 100644 --- a/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java +++ b/opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java @@ -20,9 +20,9 @@ import java.text.SimpleDateFormat; 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.hamcrest.CoreMatchers; import org.opendaylight.controller.config.api.LookupRegistry; import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry; import org.opendaylight.yangtools.yang.common.QName; diff --git a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java index 2f72ad4d47..0dd79e2723 100644 --- a/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java +++ b/opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java @@ -30,7 +30,7 @@ public class NetconfServerSessionNegotiator AbstractNetconfSessionNegotiator { private static final Logger LOG = LoggerFactory.getLogger(NetconfServerSessionNegotiator.class); - + private static final String UNKNOWN = "unknown"; protected NetconfServerSessionNegotiator( diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java index c16046c642..c5d5bede36 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java @@ -1,14 +1,13 @@ 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 java.net.InetSocketAddress; 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 diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java index fdc9a02006..5f316d11c1 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java @@ -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 java.io.File; 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"; - private File sshKeyPair; private SshProxyServer sshProxyServer; private ExecutorService nioExec; @@ -87,8 +85,6 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { @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); @@ -98,12 +94,13 @@ public class NetconfITSecureTest extends AbstractNetconfConfigTest { .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()); } diff --git a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java index dc175c5733..007dfdc1e7 100644 --- a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java +++ b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java @@ -7,9 +7,9 @@ */ 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.hamcrest.CoreMatchers.containsString; import org.junit.Test; import org.opendaylight.controller.netconf.util.xml.XmlUtil; diff --git a/opendaylight/netconf/pom.xml b/opendaylight/netconf/pom.xml index 8b14adf252..e1aa6ce3ed 100644 --- a/opendaylight/netconf/pom.xml +++ b/opendaylight/netconf/pom.xml @@ -113,7 +113,7 @@ maven-checkstyle-plugin false - false + true checkstyle-logging.xml true true