Commit 811dfb83 authored by Martti Käärik's avatar Martti Käärik
Browse files

Compiled constraints are the default. The interpreter available as a fallback...

Compiled constraints are the default. The interpreter  available as a fallback with -Dtdl.validation.constraints=interpreted
parent f2dfccff
Loading
Loading
Loading
Loading
+5 −6
Changes for plugins/org.etsi.mts.tdl.model/src/org/etsi/mts/tdl/ConstraintImplementation.java: 5 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -4,18 +4,17 @@ package org.etsi.mts.tdl;
 * Arbiter of constraint implementation to use.
 * <ul>
 * <li>{@link #INTERPRETED} - the Complete OCL documents in {@code model/*.ocl}, evaluated at run time
 * by the Eclipse OCL interpreter ({@link Validator}). This is the 
 * default.</li>
 * by the Eclipse OCL interpreter ({@link Validator}). Kept as a fallback.</li>
 * <li>{@link #COMPILED} - the same invariants (embedded) converted to Java from {@code model/*.ecore}
 * ({@code tdlValidator}, {@code StructuredObjectivesValidator},
 * {@code ExtendedConfigurationsValidator}).</li>
 * {@code ExtendedConfigurationsValidator}). This is the default.</li>
 * </ul>
 * Only one of them is active, so a constraint is never reported twice. The choice is made once per
 * process with the system property {@value #PROPERTY} ({@code interpreted} or {@code compiled}): the
 * validators live in the global {@code EValidator} registry, so switching while models are being
 * validated would mix the two. In the IDE set it in {@code eclipse.ini} or the launch configuration
 * ({@code -Dtdl.validation.constraints=compiled}); for a Maven test run pass
 * {@code -DsystemProperties=-Dtdl.validation.constraints=compiled}.
 * ({@code -Dtdl.validation.constraints=interpreted}); for a Maven test run pass
 * {@code -DsystemProperties=-Dtdl.validation.constraints=interpreted}.
 */
public enum ConstraintImplementation {

@@ -40,7 +39,7 @@ public enum ConstraintImplementation {

	static ConstraintImplementation resolve(String value) {
		if (value == null || value.isBlank()) {
			return INTERPRETED;
			return COMPILED;
		}
		switch (value.trim().toLowerCase()) {
		case "compiled":
+1 −1
Changes for plugins/org.etsi.mts.tdl.tx.tests/src/org/etsi/mts/tdl/tx/tests/TDLtxAbstractTest.java: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public abstract class TDLtxAbstractTest {
		org.etsi.mts.tdl.extendedconfigurations.ExtendedConfigurationsPackage.eINSTANCE.getName();
		CompleteOCLStandaloneSetup.doSetup();
		// Only one implementation of the constraints is active per JVM
		// (-DsystemProperties=-Dtdl.validation.constraints=interpreted|compiled, default interpreted).
		// (-DsystemProperties=-Dtdl.validation.constraints=interpreted|compiled, default compiled).
		// Interpreted: register three  OCL documents here once, before any test creates an injector
		// (as the model plugin's activator does).
		// Compiled: the package initialisers have already registered the generated validators.