use of de.be4.classicalb.core.parser.rules.RulesMachineRunConfiguration.RuleGoalAssumption in project probparsers by bendisposto.
the class RulesMachineFilesTest method testRulesMachineConfiguration.
@Test
public void testRulesMachineConfiguration() throws Exception {
File file = new File("src/test/resources/rules/project/RulesMachineConfigurationTest.rmch");
ParsingBehaviour parsingBehaviour = new ParsingBehaviour();
parsingBehaviour.setAddLineNumbers(true);
parsingBehaviour.setPrologOutput(true);
RulesProject project = new RulesProject();
project.parseProject(file);
project.checkAndTranslateProject();
RulesMachineRunConfiguration rulesMachineRunConfiguration = project.getRulesMachineRunConfiguration();
Set<RuleGoalAssumption> rulesGoalAssumptions = rulesMachineRunConfiguration.getRulesGoalAssumptions();
assertEquals(2, rulesGoalAssumptions.size());
for (Iterator<RuleGoalAssumption> iterator = rulesGoalAssumptions.iterator(); iterator.hasNext(); ) {
RuleGoalAssumption next = iterator.next();
if ("rule1".equals(next.getRuleName())) {
assertEquals(new HashSet<Integer>(Arrays.asList(1)), next.getErrorTypesAssumedToSucceed());
assertEquals(true, next.isCheckedForCounterexamples());
assertEquals("rule1", next.getRuleOperation().getName());
} else {
assertEquals("rule2", next.getRuleName());
assertEquals(new HashSet<Integer>(Arrays.asList(1)), next.getErrorTypesAssumedToFail());
assertEquals(false, next.isCheckedForCounterexamples());
}
}
}
Aggregations