use of org.kie.dmn.validation.dtanalysis.model.DTAnalysis in project drools by kiegroup.
the class Check2ndNFViolationTest method testCheck2ndNFViolation3combo.
@Test
public void testCheck2ndNFViolation3combo() {
List<DMNMessage> validate = validator.validate(getReader("DT2ndNF3combo.dmn"), ANALYZE_DECISION_TABLE);
DTAnalysis analysis = getAnalysis(validate, "_BA703D04-803A-44AA-8A31-F5EEDD4FD54E");
assertThat(analysis.is2ndNFViolation(), is(true));
assertThat(analysis.getContractionsViolating2ndNF(), hasSize(2));
}
use of org.kie.dmn.validation.dtanalysis.model.DTAnalysis in project drools by kiegroup.
the class NotTest method testNOTString2.
@Test
public void testNOTString2() {
List<DMNMessage> validate = validator.validate(getReader("DTusingNOT2.dmn"), ANALYZE_DECISION_TABLE);
DTAnalysis analysis = getAnalysis(validate, "_b53fac34-fb12-4601-8605-c226e68292f9");
assertThat(analysis.getGaps(), hasSize(1));
@SuppressWarnings({ "unchecked", "rawtypes" }) List<Hyperrectangle> gaps = Arrays.asList(new Hyperrectangle(1, Arrays.asList(Interval.newFromBounds(new Bound("i", RangeBoundary.CLOSED, null), new Bound("o", RangeBoundary.OPEN, null)))));
assertThat(gaps, hasSize(1));
// Assert GAPS
assertThat(analysis.getGaps(), contains(gaps.toArray()));
// assert OVERLAPs count.
assertThat(analysis.getOverlaps(), hasSize(0));
}
use of org.kie.dmn.validation.dtanalysis.model.DTAnalysis in project drools by kiegroup.
the class OverlapHitPolicyTest method checkAnalysis.
private void checkAnalysis(List<DMNMessage> validate) {
DTAnalysis analysis = getAnalysis(validate, "_C4A1625B-0606-4F2D-9779-49B1A981718E");
assertThat(analysis.getGaps(), hasSize(0));
// assert OVERLAPs count.
assertThat(analysis.getOverlaps(), hasSize(1));
@SuppressWarnings({ "unchecked", "rawtypes" }) List<Overlap> overlaps = Arrays.asList(new Overlap(Arrays.asList(2, 3), new Hyperrectangle(1, Arrays.asList(Interval.newFromBounds(new Bound(new BigDecimal("30"), RangeBoundary.CLOSED, null), new Bound(new BigDecimal("30"), RangeBoundary.CLOSED, null))))));
assertThat(overlaps, hasSize(1));
// Assert OVERLAPs same values
assertThat(analysis.getOverlaps(), contains(overlaps.toArray()));
}
use of org.kie.dmn.validation.dtanalysis.model.DTAnalysis in project drools by kiegroup.
the class PiTest method checkAnalysis.
private void checkAnalysis(List<DMNMessage> validate) {
DTAnalysis analysis = getAnalysis(validate, "_F32338CF-6F14-4E66-95AE-8BD4276BA75F");
assertThat(analysis.getGaps(), hasSize(1));
@SuppressWarnings({ "unchecked", "rawtypes" }) List<Hyperrectangle> gaps = Arrays.asList(new Hyperrectangle(1, Arrays.asList(Interval.newFromBounds(new Bound(new BigDecimal("3.1415926535897932384626433832794"), RangeBoundary.CLOSED, null), new Bound(new BigDecimal("3.1415926535897932384626433832794"), RangeBoundary.CLOSED, null)))));
assertThat(gaps, hasSize(1));
// Assert GAPS
assertThat(analysis.getGaps(), contains(gaps.toArray()));
// assert OVERLAPs count.
assertThat(analysis.getOverlaps(), hasSize(0));
}
use of org.kie.dmn.validation.dtanalysis.model.DTAnalysis in project drools by kiegroup.
the class SimpleStringNoGapTest method test.
@Test
public void test() {
List<DMNMessage> validate = validator.validate(getReader("simpleStringNoGap.dmn"), VALIDATE_COMPILATION, VALIDATE_MODEL, ANALYZE_DECISION_TABLE);
// Gap Analysis skipped because of free string.
assertThat(validate, hasSize(1));
assertTrue("It should contain DMNMessage for the skipped gap analysis", validate.stream().anyMatch(p -> p.getMessageType().equals(DMNMessageType.DECISION_TABLE_GAP)));
debugValidatorMsg(validate);
DTAnalysis analysis = getAnalysis(validate, "_3D5BDDEF-8B71-4797-8662-5026A9C2A112");
assertThat(analysis.getGaps(), hasSize(0));
assertThat(analysis.getOverlaps(), hasSize(0));
}
Aggregations