use of com.buschmais.jqassistant.core.rule.impl.reader.XmlRuleSetReader in project jqa-core-framework by buschmais.
the class CompoundRuleSetReaderTest method testReadUrlSource.
@Test
public void testReadUrlSource() throws Exception {
RuleSetBuilder ruleSetBuilder = RuleSetBuilder.newInstance();
URL url = getClass().getResource("/test-concepts.xml");
RuleSetReader reader = new XmlRuleSetReader(RuleConfiguration.builder().build());
reader.read(singletonList(new UrlRuleSource(url)), ruleSetBuilder);
RuleSet ruleSet = ruleSetBuilder.getRuleSet();
assertThat(ruleSet.getConceptBucket().size(), equalTo(1));
assertThat(ruleSet.getConstraintBucket().size(), equalTo(1));
assertThat(ruleSet.getConceptBucket().getIds(), contains("java:Throwable"));
assertThat(ruleSet.getConstraintBucket().getIds(), contains("example:ConstructorOfDateMustNotBeUsed"));
assertThat(ruleSet.getGroupsBucket().size(), equalTo(1));
Group group = ruleSet.getGroupsBucket().getById("default");
assertThat(group.getId(), equalTo("default"));
}
Aggregations