From 4218884ee87436e45bc590291e5f3c7175f67930 Mon Sep 17 00:00:00 2001
From: Oliver Burn
Date: Tue, 21 Sep 2010 06:23:29 +0000
Subject: [PATCH] got the test to run under maven
---
.../com/puppycrawl/tools/checkstyle/Checker.java | 2 +-
.../com/puppycrawl/tools/checkstyle/CheckerTest.java | 11 ++++++-----
src/xdocs/running.xml | 4 ++--
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
index b99317967..eaa79f209 100644
--- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
+++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Checker.java
@@ -220,7 +220,7 @@ public class Checker extends AutomaticBean implements MessageDispatcher
* Add the listener that will be used to receive events from the audit.
* @param aListener the nosy thing
*/
- public void addListener(AuditListener aListener)
+ public final void addListener(AuditListener aListener)
{
mListeners.add(aListener);
}
diff --git a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java
index 7dac9ee0e..c0518062e 100644
--- a/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java
+++ b/src/tests/com/puppycrawl/tools/checkstyle/CheckerTest.java
@@ -12,7 +12,6 @@ import com.puppycrawl.tools.checkstyle.api.Filter;
import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
import java.io.File;
import java.util.TreeSet;
-import org.junit.Ignore;
import org.junit.Test;
public class CheckerTest
@@ -26,21 +25,23 @@ public class CheckerTest
assertEquals("C:\\a\\b\\d", c.getBasedir());
}
- @Ignore @Test // Need to resolve why fails under Maven.
+ @Test
public void testOsBasedir() throws Exception
{
final Checker c = new Checker();
// we need something to create absolute path
// let's take testinputs.dir
- String testinputs_dir = System.getProperty("testinputs.dir");
+ String testinputs_dir = System.getProperty("testinputs.dir")
+ .replace('/', File.separatorChar)
+ .replace('\\',File.separatorChar);
if (!testinputs_dir.endsWith(File.separator)) {
testinputs_dir += File.separator;
}
- c.setBasedir(testinputs_dir + "indentation/./..\\coding\\");
- assertEquals(c.getBasedir(), testinputs_dir + "coding");
+ final String instr = testinputs_dir + "indentation/./..\\coding\\";
+ c.setBasedir(instr);
assertTrue((testinputs_dir + "coding").equalsIgnoreCase(c.getBasedir()));
}
diff --git a/src/xdocs/running.xml b/src/xdocs/running.xml
index d7b5c2762..d5b57536c 100755
--- a/src/xdocs/running.xml
+++ b/src/xdocs/running.xml
@@ -15,12 +15,12 @@
This section documents the out-of-box supported methods for
running Checkstyle.
-
+
-
+
Note that there are loads of
plug-ins for all the IDE's out there.