use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorInformationRequirementTest method testINFOREQ_DECISION_NOT_DECISION_ReaderInput.
@Test
public void testINFOREQ_DECISION_NOT_DECISION_ReaderInput() throws IOException {
try (final Reader reader = getReader("informationrequirement/INFOREQ_DECISION_NOT_DECISION.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(2));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.REQ_NOT_FOUND)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorInputDataTest method testINPUT_MISSING_VAR_ReaderInput.
@Test
public void testINPUT_MISSING_VAR_ReaderInput() throws IOException {
try (final Reader reader = getReader("inputdata/INPUTDATA_MISSING_VAR.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(1));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_VARIABLE)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorInputDataTest method testINPUT_MISMATCH_VAR_ReaderInput.
@Test
public void testINPUT_MISMATCH_VAR_ReaderInput() throws IOException {
try (final Reader reader = getReader("inputdata/INPUTDATA_MISMATCH_VAR.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(1));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.VARIABLE_NAME_MISMATCH)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorKnowledgeRequirementTest method testKNOWREQ_MISSING_BKM_ReaderInput.
@Test
public void testKNOWREQ_MISSING_BKM_ReaderInput() throws IOException {
try (final Reader reader = getReader("knowledgerequirement/KNOWREQ_MISSING_BKM.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(2));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.REQ_NOT_FOUND)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorTypeRefTest method testTYPEREF_NO_NS_ReaderInput.
@Test
public void testTYPEREF_NO_NS_ReaderInput() throws IOException {
try (final Reader reader = getReader("typeref/TYPEREF_NO_NS.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(2));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.FAILED_XML_VALIDATION)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.TYPE_DEF_NOT_FOUND)));
}
}
Aggregations