diff --git a/src/main/java/ru/ewc/checklogic/testing/CheckFile.java b/src/main/java/ru/ewc/checklogic/testing/CheckFile.java index ef70d66..aa5312e 100644 --- a/src/main/java/ru/ewc/checklogic/testing/CheckFile.java +++ b/src/main/java/ru/ewc/checklogic/testing/CheckFile.java @@ -35,6 +35,7 @@ import ru.ewc.decisions.api.RuleFragments; import ru.ewc.decisions.commands.Assignment; import ru.ewc.decisions.conditions.Condition; +import ru.ewc.decisions.core.Coordinate; /** * I am a single file containing one or more tests. I am responsible for performing all the tests @@ -73,6 +74,7 @@ public CheckFile(final String file, final List tests, final Strin public List performChecks(final String root, final CheckSuite files) { this.suite = files; return this.tests.stream() + .filter(rule -> rule.getFragments().stream().anyMatch(f -> f.nonEmptyOfType("CND"))) .map(rule -> this.getTestResult(rule, ServerContextFactory.create(root).context())) .toList(); } @@ -93,7 +95,7 @@ private TestResult getTestResult(final RuleFragments rule, final ComputationCont if (!check.evaluate(ctx)) { failures.add(new CheckFailure(check.asString(), check.result())); } - } catch (final DecitaException exception) { + } catch (final DecitaException | IllegalArgumentException exception) { failures.add( new CheckFailure( check.asString(), @@ -104,7 +106,7 @@ private TestResult getTestResult(final RuleFragments rule, final ComputationCont } else { try { this.perform(fragment, ctx); - } catch (DecitaException exception) { + } catch (final DecitaException | IllegalArgumentException exception) { failures.add(new CheckFailure("", exception.getMessage())); } } @@ -123,7 +125,9 @@ private void perform(final RuleFragment fragment, final ComputationContext ctx) case "ASG" -> new Assignment(fragment.left(), fragment.right()).performIn(ctx); case "EXE" -> { if ("command".equals(fragment.left())) { - ctx.perform(fragment.right()); + final Coordinate coordinate = Coordinate.from(fragment.right()); + coordinate.resolveIn(ctx); + ctx.perform(coordinate.valueIn(ctx)); ctx.resetComputationState(this.request); } if ("include".equals(fragment.left())) {