use of org.kie.dmn.api.core.DMNMessage in project drools by kiegroup.
the class ValidatorBusinessContextTest method testORG_UNIT_DECISION_OWNED_WRONG_TYPE_ReaderInput.
@Test
public void testORG_UNIT_DECISION_OWNED_WRONG_TYPE_ReaderInput() throws IOException {
try (final Reader reader = getReader("businesscontext/ORG_UNIT_DECISION_OWNED_WRONG_TYPE.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)));
}
}
use of org.kie.dmn.api.core.DMNMessage in project drools by kiegroup.
the class ValidatorBusinessContextTest method testPERF_INDICATOR_IMP_DECISION_WRONG_TYPE_ReaderInput.
@Test
public void testPERF_INDICATOR_IMP_DECISION_WRONG_TYPE_ReaderInput() throws IOException {
try (final Reader reader = getReader("businesscontext/PERF_INDICATOR_IMP_DECISION_WRONG_TYPE.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)));
}
}
use of org.kie.dmn.api.core.DMNMessage in project drools by kiegroup.
the class ValidatorContextTest method testCONTEXT_ENTRY_MISSING_VARIABLE_DefinitionsInput.
@Test
public void testCONTEXT_ENTRY_MISSING_VARIABLE_DefinitionsInput() {
final List<DMNMessage> validate = validator.validate(getDefinitions("context/CONTEXT_ENTRY_MISSING_VARIABLE.dmn", "https://github.com/kiegroup/kie-dmn", "CONTEXT_MISSING_EXPR"), VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(1));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_VARIABLE)));
// check that it reports and error for the second context entry, but not for the last one
final ContextEntry ce = (ContextEntry) validate.get(0).getSourceReference();
assertThat(((Context) ce.getParent()).getContextEntry().indexOf(ce), is(1));
}
use of org.kie.dmn.api.core.DMNMessage in project drools by kiegroup.
the class ValidatorDecisionTableTest method testDTABLE_MULTIPLEOUT_NAME_ReaderInput.
@Test
public void testDTABLE_MULTIPLEOUT_NAME_ReaderInput() throws IOException {
try (final Reader reader = getReader("DTABLE_MULTIPLEOUTPUT_WRONG_OUTPUT.dmn")) {
List<DMNMessage> validate = validator.validate(reader, VALIDATE_SCHEMA, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(5));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_NAME)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_TYPE_REF)));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.INVALID_NAME)));
}
}
use of org.kie.dmn.api.core.DMNMessage in project drools by kiegroup.
the class ValidatorDecisionTableTest method testDTABLE_EMPTY_ENTRY_ReaderInput.
@Test
public void testDTABLE_EMPTY_ENTRY_ReaderInput() throws IOException {
try (final Reader reader = getReader("DTABLE_EMPTY_ENTRY.dmn")) {
final List<DMNMessage> validate = validator.validate(reader, VALIDATE_MODEL, VALIDATE_COMPILATION);
assertThat(ValidatorUtil.formatMessages(validate), validate.size(), is(2));
assertTrue(validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.MISSING_EXPRESSION)));
}
}
Aggregations