diff --git a/pmd-apex/src/main/resources/category/apex/bestpractices.xml b/pmd-apex/src/main/resources/category/apex/bestpractices.xml index f91fa5095a..5c13033efc 100644 --- a/pmd-apex/src/main/resources/category/apex/bestpractices.xml +++ b/pmd-apex/src/main/resources/category/apex/bestpractices.xml @@ -10,6 +10,7 @@ Rules which enforce generally accepted best practices. - - - - - - - - - - - \n" + private static final String REFERENCE_TO_DEPRECATED_RULE = "\n" + "\n" + "testdesc\n" - + "\n" + - ""; + + "\n" + + ""; private static final String REFERENCE_TO_RULESET_WITH_DEPRECATED_RULE = "\n" + "\n" + "testdesc\n" - + "\n" + - ""; + + "\n" + + ""; private static final String DFA = "\n" + "\n" diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 22f3af5c00..24b5bbbcff 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -44,7 +44,11 @@ commons-io commons-io - + + com.github.stefanbirkner + system-rules + compile + org.mockito mockito-core diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java index 23834d26b2..164e0590a3 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/AbstractRuleSetFactoryTest.java @@ -33,6 +33,7 @@ import javax.xml.parsers.SAXParserFactory; import org.apache.commons.io.FilenameUtils; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemErrRule; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; @@ -50,6 +51,9 @@ import net.sourceforge.pmd.util.ResourceLoader; * subclassed for each language. */ public abstract class AbstractRuleSetFactoryTest { + @org.junit.Rule + public final SystemErrRule systemErrRule = new SystemErrRule().enableLog().muteForSuccessfulTests(); + private static SAXParserFactory saxParserFactory; private static ValidateDefaultHandler validateDefaultHandler; private static SAXParser saxParser;