use of org.kie.dmn.validation.DMNValidator.Validation in project drools by kiegroup.
the class PMMLValidatorImportTest method testImportPMML2.
@Test
public void testImportPMML2() throws IOException {
// DROOLS-4395 [DMN Designer] Validation fails for included PMML model
try (Reader defsReader = getReader("KiePMMLScoreCard_wInputType.dmn", DMNRuntimePMMLTest.class)) {
final Definitions defs = getDefinitions(defsReader, "http://www.trisotech.com/definitions/_ca466dbe-20b4-4e88-a43f-4ce3aff26e4f", "KiePMMLScoreCard");
DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver resolver = (ns, name, i) -> {
if (ns.equals(defs.getNamespace()) && name.equals(defs.getName()) && i.equals(defs.getImport().get(0).getLocationURI())) {
return getReader("test_scorecard.pmml", DMNRuntimePMMLTest.class);
} else {
return null;
}
};
final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL, Validation.VALIDATE_COMPILATION).usingImports(resolver).theseModels(defs);
assertThat(ValidatorUtil.formatMessages(messages), messages.size(), is(0));
}
}
Aggregations