Bug 8153: enforce check-style rules for netconf 42/57142/15
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Tue, 16 May 2017 12:14:27 +0000 (14:14 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Fri, 19 May 2017 08:37:57 +0000 (08:37 +0000)
- enforce checkstyle in all modules + cleanup

Change-Id: I64b003c8f8f554445423e54642ef46bb95bc90b1
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
netconf/netconf-auth/pom.xml
netconf/netconf-mapping-api/pom.xml
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/api/package-info.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/package-info.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/util/package-info.java
netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/KeepaliveSalFacadeTest.java
netconf/yanglib/pom.xml

index 7733900f63be782e004ee58bee3f127e154dd7b7..9134e57235dec27a6b759189c3feeb0d5b09e05f 100644 (file)
     <version>1.3.0-SNAPSHOT</version>
     <name>${project.artifactId}</name>
     <packaging>bundle</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
index ba7bdb18c17045a09dfcc627e8699e050377060a..387d8e139b05e7298e378d5c43a4f3a7f70ab88b 100644 (file)
       <artifactId>guava</artifactId>
     </dependency>
   </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
index 399cdf0f3b5f715613562d44419e2dfe32b052c0..7fce9bea4ee3c72edf09c39db495a26c69c395d7 100644 (file)
@@ -7,6 +7,6 @@
  */
 
 /**
- * API for netconf connector
+ * API for netconf connector.
  */
 package org.opendaylight.netconf.sal.connect.api;
index 60b3ee0d76126ad1c865c99126756713b043d0a1..44171369ac04fc2fb0b590dc34c949be6c66e2f6 100644 (file)
@@ -7,6 +7,6 @@
  */
 
  /**
- * Implementation of netconf southbound connector
+ * Implementation of netconf southbound connector.
  */
 package org.opendaylight.netconf.sal.connect.netconf;
index 9b12a4166ec9c1bcdf9e8bb992242245fe0978b7..7942c879716dd226ac4aa3368fe4b3b32897b479 100644 (file)
@@ -7,6 +7,6 @@
  */
 
  /**
- * Utility classes for netconf connector
+ * Utility classes for netconf connector.
  */
 package org.opendaylight.netconf.sal.connect.util;
index 654c6ab66c1f5155ce7d18daca5953f3a94492d0..f0b791a3b3ef030c4bb8549305db912e550a9deb 100644 (file)
@@ -21,7 +21,6 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -29,8 +28,6 @@ import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
 import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
@@ -79,15 +76,11 @@ public class KeepaliveSalFacadeTest {
 
         ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
         executorServiceSpy = Mockito.spy(executorService);
-        doAnswer(new Answer<ScheduledFuture>() {
-            @Override
-            public ScheduledFuture answer(InvocationOnMock invocationOnMock)
-                    throws Throwable {
+        doAnswer(
+            invocationOnMock -> {
                 invocationOnMock.callRealMethod();
                 return currentKeepalive;
-            }
-        }).when(executorServiceSpy).schedule(Mockito.<Runnable>any(),
-                Mockito.anyLong(), Matchers.<TimeUnit>any());
+            }).when(executorServiceSpy).schedule(Mockito.<Runnable>any(), Mockito.anyLong(), Matchers.any());
 
         Mockito.when(currentKeepalive.isDone()).thenReturn(true);
     }
@@ -178,13 +171,11 @@ public class KeepaliveSalFacadeTest {
 
     @Test
     public void testNonKeepaliveRpcFailure() throws Exception {
-        doAnswer(new Answer() {
-            @Override
-            public Object answer(final InvocationOnMock invocationOnMock) throws Throwable {
+        doAnswer(
+            invocationOnMock -> {
                 proxyRpc = (DOMRpcService) invocationOnMock.getArguments()[2];
                 return null;
-            }
-        }).when(underlyingSalFacade).onDeviceConnected(
+            }).when(underlyingSalFacade).onDeviceConnected(
                 any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class));
 
         doReturn(Futures.immediateFailedCheckedFuture(new IllegalStateException("illegal-state")))
index 33e21b07f0aee478bb1b96cef04267e4fc022470..74011a592b86fcb858dfd1838be32708d4633c5e 100644 (file)
                     </instructions>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
         </plugins>
     </build>