got the test to run under maven

This commit is contained in:
Oliver Burn 2010-09-21 06:23:29 +00:00
parent 4c124c309f
commit 4218884ee8
3 changed files with 9 additions and 8 deletions

View File

@ -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);
}

View File

@ -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()));
}

View File

@ -15,12 +15,12 @@
This section documents the out-of-box supported methods for
running Checkstyle.
</p>
<ul>
<li>An <a href="anttask.html">Ant task</a>.</li>
<li>A <a href="cmdline.html">Command Line</a> tool.</li>
</ul>
<p>
Note that there are <a href="index.html#Related Tools">loads of
plug-ins</a> for all the IDE's out there.