RuleSetFactoryCompatibility { void addFilterRuleRenamed(String language, String ruleset, String oldName, String newName) { filters.add(RuleSetFilter.ruleRenamed(language, ruleset, oldName, newName)); } RuleSetFactoryCompatibility(); Reader filterRuleSetFile(InputStream stream);  }
@Test public void testExclusion() throws Exception { final String ruleset = "<?xml version=\"1.0\"?>\n" + "\n" + "<ruleset name=\"Test\"\n" + " xmlns=\"http: + " xmlns:xsi=\"http: + " xsi:schemaLocation=\"http: + " <description>Test</description>\n" + "\n" + " <rule ref=\"rulesets/dummy/basic.xml\">\n" + " <exclude name=\"OldNameOfSampleXPathRule\"/>\n" + " </rule>\n" + "</ruleset>\n"; RuleSetFactory factory = RulesetsFactoryUtils.defaultFactory(); factory.getCompatibilityFilter().addFilterRuleRenamed("dummy", "basic", "OldNameOfSampleXPathRule", "SampleXPathRule"); RuleSet createdRuleSet = createRulesetFromString(ruleset, factory); Assert.assertNotNull(createdRuleSet.getRuleByName("DummyBasicMockRule")); Assert.assertNull(createdRuleSet.getRuleByName("SampleXPathRule")); }