diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml
index aee31e3989..83f1e28be6 100644
--- a/pmd-apex/pom.xml
+++ b/pmd-apex/pom.xml
@@ -73,6 +73,11 @@
junit
test
+
+ com.github.stefanbirkner
+ system-rules
+ test
+
net.sourceforge.pmd
pmd-test
diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java
index 6f227c691c..9646085c85 100644
--- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java
+++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/DefaultRulesetTest.java
@@ -4,26 +4,32 @@
package net.sourceforge.pmd.lang.apex;
-import static org.junit.Assert.assertNotNull;
-
+import org.junit.Assert;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.contrib.java.lang.system.SystemErrRule;
+import net.sourceforge.pmd.RulePriority;
import net.sourceforge.pmd.RuleSet;
import net.sourceforge.pmd.RuleSetFactory;
+import net.sourceforge.pmd.util.ResourceLoader;
public class DefaultRulesetTest {
+ @Rule
+ public final SystemErrRule systemErrRule = new SystemErrRule().enableLog().muteForSuccessfulTests();
- private RuleSetFactory factory = new RuleSetFactory();
+ private RuleSetFactory factory = new RuleSetFactory(new ResourceLoader(), RulePriority.LOW, true, false);
@Test
public void loadDefaultRuleset() throws Exception {
RuleSet ruleset = factory.createRuleSet("rulesets/apex/ruleset.xml");
- assertNotNull(ruleset);
+ Assert.assertNotNull(ruleset);
}
@Test
public void loadQuickstartRuleset() throws Exception {
RuleSet ruleset = factory.createRuleSet("rulesets/apex/quickstart.xml");
- assertNotNull(ruleset);
+ Assert.assertNotNull(ruleset);
+ Assert.assertTrue(systemErrRule.getLog().isEmpty());
}
}
diff --git a/pmd-java/src/main/resources/rulesets/java/quickstart.xml b/pmd-java/src/main/resources/rulesets/java/quickstart.xml
index f2cf5c60b0..a3e1aff5aa 100644
--- a/pmd-java/src/main/resources/rulesets/java/quickstart.xml
+++ b/pmd-java/src/main/resources/rulesets/java/quickstart.xml
@@ -10,6 +10,7 @@
+
@@ -17,6 +18,7 @@
+
@@ -29,64 +31,56 @@
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -94,27 +88,19 @@
-
-
-
-
-
-
-
-
+
-
@@ -123,9 +109,11 @@
+
+
@@ -133,11 +121,13 @@
+
-
+
+
-
+
@@ -149,18 +139,18 @@
-
-
+
+
+
+
+
+
-
-
-
-
@@ -171,12 +161,15 @@
+
+
+
@@ -214,40 +207,21 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -288,6 +262,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -295,10 +283,11 @@
-
+
+
@@ -330,4 +319,7 @@
+
+
+
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java
new file mode 100644
index 0000000000..8a08cd179e
--- /dev/null
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java
@@ -0,0 +1,31 @@
+/**
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+package net.sourceforge.pmd.lang.java;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.contrib.java.lang.system.SystemErrRule;
+
+import net.sourceforge.pmd.RulePriority;
+import net.sourceforge.pmd.RuleSet;
+import net.sourceforge.pmd.RuleSetFactory;
+import net.sourceforge.pmd.RuleSetNotFoundException;
+import net.sourceforge.pmd.util.ResourceLoader;
+
+public class QuickstartRulesetTest {
+
+ @Rule
+ public final SystemErrRule systemErrRule = new SystemErrRule().enableLog();
+
+ @Test
+ public void noDeprecations() throws RuleSetNotFoundException {
+ RuleSetFactory ruleSetFactory = new RuleSetFactory(new ResourceLoader(), RulePriority.LOW, true, false);
+ RuleSet quickstart = ruleSetFactory.createRuleSet("rulesets/java/quickstart.xml");
+ Assert.assertFalse(quickstart.getRules().isEmpty());
+
+ Assert.assertTrue(systemErrRule.getLog().isEmpty());
+ }
+}