Fix tests

This commit is contained in:
Clément Fournier
2022-05-17 21:31:43 +02:00
parent 9f98d5e264
commit fa41583254
3 changed files with 8 additions and 5 deletions

View File

@ -28,7 +28,7 @@ when used on the CLI or in a ruleset XML file:
- `<lang-name>-<ruleset-name>`, eg `java-basic`, which resolves to `rulesets/java/basic.xml`
- the internal release number, eg `600`, which resolves to `rulesets/releases/600.xml`
Use the explicit forms of these references
Use the explicit forms of these references to be compatible with PMD 7.
#### Deprecated API

View File

@ -77,6 +77,9 @@ import net.sourceforge.pmd.util.ResourceLoader;
@InternalApi
public class RuleSetReferenceId {
// todo this class has issues... What is even an "external" ruleset?
// terminology and API should be clarified.
// use the logger of RuleSetFactory, because the warnings conceptually come from there.
private static final Logger LOG = Logger.getLogger(RuleSetFactory.class.getName());

View File

@ -80,8 +80,8 @@ public class CLITest extends BaseCLITest {
public void testWrongRuleset() {
String[] args = { "-d", SOURCE_FOLDER, "-f", "text", "-R", "category/java/designn.xml", };
String log = runTest(StatusCode.ERROR, args);
assertThat(log, containsString("Can't find resource 'category/java/designn.xml' for rule 'null'."
+ " Make sure the resource is a valid file"));
assertThat(log, containsString("Cannot resolve rule/ruleset reference "
+ "'category/java/designn.xml'"));
}
/**
@ -91,8 +91,8 @@ public class CLITest extends BaseCLITest {
public void testWrongRulesetWithRulename() {
String[] args = { "-d", SOURCE_FOLDER, "-f", "text", "-R", "category/java/designn.xml/UseCollectionIsEmpty", };
String log = runTest(StatusCode.ERROR, args);
assertThat(log, containsString("Can't find resource 'category/java/designn.xml' for rule "
+ "'UseCollectionIsEmpty'."));
assertThat(log, containsString("Cannot resolve rule/ruleset reference"
+ " 'category/java/designn.xml/UseCollectionIsEmpty'"));
}
/**