use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorContextTest method testCONTEXT_MISSING_ENTRIES_ReaderInput.
@Test
public void testCONTEXT_MISSING_ENTRIES_ReaderInput() throws IOException {
try (final Reader reader = getReader("context/CONTEXT_MISSING_ENTRIES.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_EXPRESSION)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorDMNElementReferenceTest method testELEMREF_NOHASH_ReaderInput.
@Test
public void testELEMREF_NOHASH_ReaderInput() throws IOException {
try (final Reader reader = getReader("dmnelementref/ELEMREF_NOHASH.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(3));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.INVALID_HREF_SYNTAX)));
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 ValidatorDecisionTableTest method testDTABLE_PRIORITY_MISSING_OUTVALS_ReaderInput.
@Test
public void testDTABLE_PRIORITY_MISSING_OUTVALS_ReaderInput() throws IOException {
try (final Reader reader = getReader("DTABLE_PRIORITY_MISSING_OUTVALS.dmn")) {
List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.isEmpty(), is(false));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_OUTPUT_VALUES)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorDecisionTableTest method testDTABLE_SINGLEOUT_NONAME_ReaderInput.
@Test
public void testDTABLE_SINGLEOUT_NONAME_ReaderInput() throws IOException {
try (final Reader reader = getReader("DTABLE_SINGLEOUTPUT_WRONG_OUTPUT.dmn")) {
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.ILLEGAL_USE_OF_NAME)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.ILLEGAL_USE_OF_TYPEREF)));
}
}
use of org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA in project drools by kiegroup.
the class ValidatorDecisionTest method testDECISION_CYCLIC_DEPENDENCY_ReaderInput.
@Test
public void testDECISION_CYCLIC_DEPENDENCY_ReaderInput() throws IOException {
try (final Reader reader = getReader("decision/DECISION_CYCLIC_DEPENDENCY.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.REQ_NOT_FOUND)));
}
}
Aggregations