-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Test Ruleset" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> | ||
|
||
<description> | ||
Ruleset used by test RuleSetFactoryCompatibilityTest | ||
</description> | ||
|
||
<rule deprecated="true" name="OldNameOfDummyBasicMockRule" ref="rulesets/dummy/oldbasic.xml/DummyBasicMockRule"/> | ||
</ruleset> |
25 changes: 25 additions & 0 deletions
25
pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMD5RulesetTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* 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.Test; | ||
|
||
import net.sourceforge.pmd.RulePriority; | ||
import net.sourceforge.pmd.RuleSet; | ||
import net.sourceforge.pmd.RuleSetFactory; | ||
import net.sourceforge.pmd.util.ResourceLoader; | ||
|
||
public class PMD5RulesetTest { | ||
|
||
@Test | ||
public void loadRuleset() throws Exception { | ||
RuleSetFactory ruleSetFactory = new RuleSetFactory(new ResourceLoader(), RulePriority.LOW, true, true); | ||
RuleSet ruleset = ruleSetFactory.createRuleSet("net/sourceforge/pmd/lang/java/pmd5ruleset.xml"); | ||
Assert.assertNotNull(ruleset); | ||
Assert.assertNull(ruleset.getRuleByName("GuardLogStatementJavaUtil")); | ||
Assert.assertNull(ruleset.getRuleByName("GuardLogStatement")); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/pmd5ruleset.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
|
||
<ruleset name="custom-ruleset" | ||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> | ||
<description> | ||
custom ruleset | ||
</description> | ||
|
||
<rule ref="rulesets/java/logging-java.xml"> | ||
<exclude name="GuardLogStatementJavaUtil"/> | ||
</rule> | ||
|
||
</ruleset> |