Wraps the static code analyze tool PMD into a simple JUnit test.
Download the latest version here:
https://github.com/corgrath/JUnit-PMD-Test-Wrapper/downloads/
Download the latest version of JUnit PMD Test Wrapper and add it to the project.
Download the latest version of PMD and add it to the project.
Download PMD from: http://sourceforge.net/projects/pmd/files/pmd/4.2.5/
Write a JUnit test case using the wrapper.
package src;
import com.osbcp.junitpmdtestwrapper.JUnitPMDTestWrapper;
import org.junit.Test;
public class TestPMD {
@Test
public void testSRC() throws Exception {
JUnitPMDTestWrapper.run(this, "src/", "pmd.xml");
}
}
Create a PMD rule set file and add it in the same folder as the test.
Guide: http://pmd.sourceforge.net/rules/index.html
Or download our sample file: https://github.com/corgrath/JUnit-PMD-Test-Wrapper/raw/master/doc/wiki/pmd.xml
http://dl.dropbox.com/u/8183146/persistent/projects/java_junit_pmd_test_wrapper/javadoc/index.html
JUnit PMD Test Wrapper - Copyright 2011 Christoffer Pettersson, christoffer@christoffer.me
Licensed under the Apache License, Version 2.0