Bumped Checkstyle to 6.1.1 to be in sync with Maven plugin. 07/19207/1
authorTony Tkacik <ttkacik@cisco.com>
Tue, 28 Apr 2015 12:31:22 +0000 (14:31 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 28 Apr 2015 12:31:29 +0000 (14:31 +0200)
Checkstyle checks needs to be in sync with Checkstyle maven
plugin due to static final constants, which were not
preserved between 2.14 and 2.15 which resulted in
NullPointerExceptions.

Change-Id: I043a9b8bf196b44636f3496e5fd65efce9eccc80
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
common/checkstyle-logging/pom.xml
common/checkstyle-logging/src/test/java/org/opendaylight/yangtools/checkstyle/CheckstyleTest.java

index 889ef2b65822fdf050644d8fc97af4c80318985e..238e78c7ea509ba0ea52587cdd163fd9a7f1e7c5 100644 (file)
@@ -21,7 +21,7 @@
     <dependency>
       <groupId>com.puppycrawl.tools</groupId>
       <artifactId>checkstyle</artifactId>
-      <version>5.7</version>
+      <version>6.1.1</version>
     </dependency>
     <dependency>
         <groupId>org.slf4j</groupId>
index 24e048ad97a2027a4989bac705dbd5e471f5baab..bf59c594b4b558ccb953f048eb9d5cc733cc29b8 100644 (file)
@@ -11,14 +11,6 @@ package org.opendaylight.yangtools.checkstyle;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.InputSource;
-
 import com.google.common.collect.Lists;
 import com.puppycrawl.tools.checkstyle.Checker;
 import com.puppycrawl.tools.checkstyle.ConfigurationLoader;
@@ -27,6 +19,12 @@ import com.puppycrawl.tools.checkstyle.PropertiesExpander;
 import com.puppycrawl.tools.checkstyle.api.AuditListener;
 import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
 import com.puppycrawl.tools.checkstyle.api.Configuration;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.xml.sax.InputSource;
 
 public class CheckstyleTest {
 
@@ -36,11 +34,11 @@ public class CheckstyleTest {
     @Before
     public void setup() throws CheckstyleException {
         baos = new ByteArrayOutputStream();
-        AuditListener listener = new DefaultLogger(baos, false);
+        final AuditListener listener = new DefaultLogger(baos, false);
 
-        InputSource inputSource = new InputSource(CheckstyleTest.class.getClassLoader().getResourceAsStream(
+        final InputSource inputSource = new InputSource(CheckstyleTest.class.getClassLoader().getResourceAsStream(
                 "checkstyle-logging.xml"));
-        Configuration configuration = ConfigurationLoader.loadConfiguration(inputSource,
+        final Configuration configuration = ConfigurationLoader.loadConfiguration(inputSource,
                 new PropertiesExpander(System.getProperties()), false);
 
         checker = new Checker();
@@ -66,7 +64,7 @@ public class CheckstyleTest {
     @Test
     public void testCodingChecks() {
         verify(CheckCodingStyleTestClass.class, false, "9: Line has Windows line delimiter.", "14: Wrong order for", "24:1: Line contains a tab character.",
-                "22: Line has trailing spaces.", "22: ctor def child at indentation level 16 not at correct indentation, 8", "17:8: Unused import",
+                "22: Line has trailing spaces.", "22: 'ctor def' child have incorrect indentation level 16, expected level should be 8.", "17:8: Unused import",
                 "23: Line has trailing spaces.");
     }