Migrated EMF-intrinsic validations to Java (removed Xtend dependency)
diff --git a/plugins/org.eclipse.app4mc.amalthea.model/xtend-gen/org/eclipse/app4mc/amalthea/model/builder/Examples.java b/plugins/org.eclipse.app4mc.amalthea.model/xtend-gen/org/eclipse/app4mc/amalthea/model/builder/Examples.java
index 8cfb526..6e07d9d 100644
--- a/plugins/org.eclipse.app4mc.amalthea.model/xtend-gen/org/eclipse/app4mc/amalthea/model/builder/Examples.java
+++ b/plugins/org.eclipse.app4mc.amalthea.model/xtend-gen/org/eclipse/app4mc/amalthea/model/builder/Examples.java
@@ -59,37 +59,37 @@
public class Examples {
@Extension
private AmaltheaBuilder b1 = new AmaltheaBuilder();
-
+
@Extension
private CommonElementsBuilder b2 = new CommonElementsBuilder();
-
+
@Extension
private SoftwareBuilder b3 = new SoftwareBuilder();
-
+
@Extension
private DatatypeBuilder b4 = new DatatypeBuilder();
-
+
@Extension
private OperatingSystemBuilder b5 = new OperatingSystemBuilder();
-
+
@Extension
private HardwareBuilder b6 = new HardwareBuilder();
-
+
@Extension
private ConstraintsBuilder b7 = new ConstraintsBuilder();
-
+
@Extension
private MappingBuilder b8 = new MappingBuilder();
-
+
public static void main(final String[] args) {
final Amalthea model1 = new Examples().model1();
AmaltheaWriter.writeToFileNamed(model1, "C:/temp/ExampleModel-gen.amxmi");
}
-
+
public static Amalthea runtimeModel1() {
return new Examples().model1();
}
-
+
public Amalthea model1() {
final Procedure1<Amalthea> _function = (Amalthea it) -> {
final Procedure1<CommonElements> _function_1 = (CommonElements it_1) -> {
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/.classpath b/plugins/org.eclipse.app4mc.amalthea.validations.standard/.classpath
index 428337e..eca7bdb 100644
--- a/plugins/org.eclipse.app4mc.amalthea.validations.standard/.classpath
+++ b/plugins/org.eclipse.app4mc.amalthea.validations.standard/.classpath
@@ -3,6 +3,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/.project b/plugins/org.eclipse.app4mc.amalthea.validations.standard/.project
index a14ed18..e9d8459 100644
--- a/plugins/org.eclipse.app4mc.amalthea.validations.standard/.project
+++ b/plugins/org.eclipse.app4mc.amalthea.validations.standard/.project
@@ -6,11 +6,6 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -34,6 +29,5 @@
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/build.properties b/plugins/org.eclipse.app4mc.amalthea.validations.standard/build.properties
index 5cf7952..50ca012 100644
--- a/plugins/org.eclipse.app4mc.amalthea.validations.standard/build.properties
+++ b/plugins/org.eclipse.app4mc.amalthea.validations.standard/build.properties
@@ -1,5 +1,4 @@
-source.. = src/,\
- xtend-gen/
+source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.java b/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.java
new file mode 100644
index 0000000..ffbd9cc
--- /dev/null
+++ b/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.java
@@ -0,0 +1,159 @@
+/**
+ * *******************************************************************************
+ * Copyright (c) 2019-2022 Robert Bosch GmbH and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Robert Bosch GmbH - initial API and implementation
+ * *******************************************************************************
+ */
+
+package org.eclipse.app4mc.amalthea.validations.standard.emf;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
+import org.eclipse.app4mc.amalthea.model.AmaltheaServices;
+import org.eclipse.app4mc.amalthea.model.INamed;
+import org.eclipse.app4mc.amalthea.model.IReferable;
+import org.eclipse.app4mc.amalthea.model.util.AmaltheaValidator;
+import org.eclipse.app4mc.validation.annotation.Validation;
+import org.eclipse.app4mc.validation.core.IValidation;
+import org.eclipse.app4mc.validation.core.Severity;
+import org.eclipse.app4mc.validation.core.ValidationDiagnostic;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * Checks EMF constraints and generated AMALTHEA invariants
+ */
+
+@Validation(
+ id = "AM-EMF-INTRINSIC",
+ checks = { "EMF extended metadata constraints (generated)",
+ "AMALTHEA invariants (generated)" })
+
+public class AmEmfIntrinsic implements IValidation {
+
+ private static final HashMap<Object, Object> CONTEXT = createContextMap();
+
+ @Override
+ public EPackage getEPackage() {
+ return AmaltheaPackage.eINSTANCE;
+ }
+
+ @Override
+ public EClassifier getEClassifier() {
+ return EcorePackage.eINSTANCE.getEObject();
+ }
+
+ @Override
+ public void validate(final EObject eObject, final List<ValidationDiagnostic> resultList) {
+ if (eObject.eClass().eContainer() == getEPackage()) {
+
+ BasicDiagnostic diagnostics = new BasicDiagnostic();
+
+ // call standard EMF validator
+ boolean valid = AmaltheaValidator.INSTANCE.validate(eObject.eClass(), eObject, diagnostics, CONTEXT);
+
+ if (!valid) {
+ for (final Diagnostic emfDiagnostic : diagnostics.getChildren()) {
+
+ final EObject problematicObject = emfDiagnostic.getData().stream()
+ .filter(EObject.class::isInstance)
+ .map(EObject.class::cast)
+ .findFirst().orElse(eObject);
+
+ final EStructuralFeature problematicFeature = emfDiagnostic.getData().stream()
+ .filter(EStructuralFeature.class::isInstance)
+ .map(EStructuralFeature.class::cast)
+ .findFirst().orElse(null);
+
+ final String subMessages = emfDiagnostic.getChildren().stream()
+ .map(Diagnostic::getMessage)
+ .map(String::trim)
+ .collect(Collectors.joining(", ", " => ", ""));
+
+ final String message = emfDiagnostic.getMessage()
+ + objectOrContainerInfo(problematicObject)
+ + (subMessages.equals(" => ") ? "" : subMessages);
+
+ ValidationDiagnostic result = new ValidationDiagnostic(message, problematicObject, problematicFeature);
+ result.setSeverityLevel(getSeverity(emfDiagnostic));
+
+ resultList.add(result);
+ }
+ }
+ }
+ }
+
+ private Severity getSeverity(final Diagnostic emfDiagnostic) {
+ switch (emfDiagnostic.getSeverity()) {
+ case Diagnostic.INFO: return Severity.INFO;
+ case Diagnostic.WARNING: return Severity.WARNING;
+ case Diagnostic.ERROR: return Severity.ERROR;
+ default: return Severity.UNDEFINED;
+ }
+
+ }
+
+ private static HashMap<Object, Object> createContextMap() {
+ final HashMap<Object, Object> map = new HashMap<>();
+
+ map.put(EValidator.SubstitutionLabelProvider.class, new EValidator.SubstitutionLabelProvider() {
+ @Override
+ public String getFeatureLabel(final EStructuralFeature eStructuralFeature) {
+ return eStructuralFeature.getName();
+ }
+
+ @Override
+ public String getObjectLabel(final EObject eObject) {
+ final String s1 = eObject.eClass().getName();
+ final String s2 = (eObject instanceof INamed) ? " " + ((INamed) eObject).getName() : "";
+ return s1 + s2;
+ }
+
+ @Override
+ public String getValueLabel(final EDataType eDataType, final Object value) {
+ return EcoreUtil.convertToString(eDataType, value);
+ }
+ });
+ return map;
+ }
+
+ private String objectOrContainerInfo(final EObject object) {
+ if (object != null) {
+
+ if (object instanceof IReferable && isValid(((IReferable) object).getName())) {
+ return " ( in " + objectInfo(object) + " )";
+ }
+
+ final IReferable container = AmaltheaServices.getContainerOfType(object, IReferable.class);
+ if (container != null && isValid(container.getName())) {
+ return (" ( in " + objectInfo(container)) + " )";
+ }
+ }
+
+ return "";
+ }
+
+ private boolean isValid(String s) {
+ return !(s == null || s.isEmpty());
+ }
+
+}
diff --git a/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.xtend b/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.xtend
deleted file mode 100644
index 5e106cd..0000000
--- a/plugins/org.eclipse.app4mc.amalthea.validations.standard/src/org/eclipse/app4mc/amalthea/validations/standard/emf/AmEmfIntrinsic.xtend
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * *******************************************************************************
- * Copyright (c) 2019-2020 Robert Bosch GmbH and others.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- * *******************************************************************************
- */
-
-package org.eclipse.app4mc.amalthea.validations.standard.emf
-
-import java.util.HashMap
-import java.util.List
-import org.eclipse.app4mc.amalthea.model.AmaltheaPackage
-import org.eclipse.app4mc.amalthea.model.AmaltheaServices
-import org.eclipse.app4mc.amalthea.model.INamed
-import org.eclipse.app4mc.amalthea.model.IReferable
-import org.eclipse.app4mc.amalthea.model.util.AmaltheaValidator
-import org.eclipse.app4mc.validation.annotation.Validation
-import org.eclipse.app4mc.validation.core.IValidation
-import org.eclipse.app4mc.validation.core.Severity
-import org.eclipse.app4mc.validation.core.ValidationDiagnostic
-import org.eclipse.emf.common.util.BasicDiagnostic
-import org.eclipse.emf.common.util.Diagnostic
-import org.eclipse.emf.ecore.EDataType
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.emf.ecore.EStructuralFeature
-import org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider
-import org.eclipse.emf.ecore.EcorePackage
-import org.eclipse.emf.ecore.util.EcoreUtil
-
-/**
- * Checks EMF constraints and generated AMALTHEA invariants
- */
-
-@Validation(
- id = "AM-EMF-INTRINSIC",
- checks = #[ "EMF extended metadata constraints (generated)",
- "AMALTHEA invariants (generated)" ])
-
-class AmEmfIntrinsic implements IValidation {
-
- val CONTEXT = createContextMap
-
- override getEPackage() {
- AmaltheaPackage.eINSTANCE
- }
-
- override getEClassifier() {
- EcorePackage.eINSTANCE.EObject
- }
-
- override validate(EObject eObject, List<ValidationDiagnostic> resultList) {
- if (eObject.eClass().eContainer() === getEPackage()) {
-
- var BasicDiagnostic diagnostics = new BasicDiagnostic()
-
- // call standard EMF validator
- var boolean valid = AmaltheaValidator.INSTANCE.validate(eObject.eClass(), eObject, diagnostics, CONTEXT)
-
- if (!valid) {
- for (Diagnostic emfDiagnostic : diagnostics.getChildren()) {
-
- val problematicObject = emfDiagnostic.getData().findFirst[e|e instanceof EObject] as EObject
- val problematicFeature = emfDiagnostic.getData().findFirst[e|e instanceof EStructuralFeature] as EStructuralFeature
-
- val ValidationDiagnostic result = new ValidationDiagnostic(
- emfDiagnostic.getMessage()
- + objectOrContainerInfo(problematicObject)
- + emfDiagnostic.children.map[message].join(" => ", ", ", "", [trim]),
- if(problematicObject !== null) problematicObject else eObject,
- problematicFeature
- )
-
- result.setSeverityLevel(
- switch (emfDiagnostic.getSeverity()) {
- case Diagnostic.INFO : Severity.INFO
- case Diagnostic.WARNING : Severity.WARNING
- case Diagnostic.ERROR : Severity.ERROR
- default : Severity.UNDEFINED
- }
- )
-
- resultList.add(result)
- }
- }
-
- }
- }
-
-
- def private objectOrContainerInfo(EObject object) {
- if (object === null) return ""
- if (object instanceof IReferable && !(object as IReferable).name.nullOrEmpty) return " ( in " + objectInfo(object) + " )"
-
- val container = AmaltheaServices.getContainerOfType(object, IReferable)
- if (container === null || container.name.nullOrEmpty) return ""
-
- return " ( in " + objectInfo(container) + " )"
- }
-
- def private static createContextMap() {
- val map = new HashMap<Object, Object>
-
- // Set a custom label provider
- map.put(SubstitutionLabelProvider, new SubstitutionLabelProvider {
- override getFeatureLabel(EStructuralFeature eStructuralFeature) {
- eStructuralFeature.name
- }
- override getObjectLabel(EObject eObject) {
- val s1 = eObject.eClass().getName()
- val s2 = if(eObject instanceof INamed) " " + (eObject as INamed).name else ""
- s1 + s2
- }
- override getValueLabel(EDataType eDataType, Object value) {
- EcoreUtil.convertToString(eDataType, value) // default
- }
- })
-
- return map
- }
-
-}
diff --git a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.xtend b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.xtend
index e63bac7..e4018ce 100644
--- a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.xtend
+++ b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/src/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.xtend
@@ -1,6 +1,6 @@
/**
* *******************************************************************************
- * Copyright (c) 2018-2019 Robert Bosch GmbH and others.
+ * Copyright (c) 2018-2022 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -29,6 +29,7 @@
import static org.eclipse.app4mc.amalthea.model.TimeUnit.*
import static org.eclipse.app4mc.amalthea.model.util.FactoryUtil.*
import static org.junit.Assert.*
+import java.util.stream.Collectors
class EMFIntrinsicTests {
@@ -58,8 +59,8 @@
val validationResult = runExecutor(model)
val errors = validationResult.filter[severityLevel == Severity.ERROR].toMap([it.targetObject.eContainer],[it.message])
- assertTrue(errors.get(_find(model, SporadicActivation, "a1")) == "TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a1\" )")
- assertTrue(errors.get(_find(model, SporadicActivation, "a2")) == "TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a2\" )")
+ assertEquals("TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a1\" )", errors.get(_find(model, SporadicActivation, "a1")))
+ assertEquals("TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a2\" )", errors.get(_find(model, SporadicActivation, "a2")))
}
@Test
@@ -76,7 +77,40 @@
val validationResult = runExecutor(model)
val errors = validationResult.filter[severityLevel == Severity.ERROR].toMap([it.targetObject.eContainer],[it.message])
- assertTrue(errors.get(_find(model, SporadicActivation, "a1")) == "TimeGaussDistribution: lower bound > upper bound ( in Sporadic Activation \"a1\" )")
+ assertEquals("TimeGaussDistribution: lower bound > upper bound ( in Sporadic Activation \"a1\" )", errors.get(_find(model, SporadicActivation, "a1")))
+ }
+
+ @Test
+ def void testMissingName() {
+ val model = amalthea [
+ softwareModel [
+ label [
+ displayName = "l1"
+ constant = true
+ ]
+ label [
+ displayName = "l2"
+ constant = true
+ ]
+ runnable [
+ name = "run1"
+ activityGraph [
+ labelAccess []
+ labelAccess []
+ ]
+ ]
+ runnable [
+ name = "run2"
+ activityGraph [
+ runnableCall []
+ ]
+ ]
+ ]
+ ]
+ val validationResult = runExecutor(model)
+ val errors = validationResult.stream.filter[it.severityLevel == Severity.ERROR].map[it.message].collect(Collectors.toList)
+
+ assertEquals(5, errors.size)
}
}
diff --git a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.java b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.java
index 2c459b0..6d31a6f 100644
--- a/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.java
+++ b/tests/org.eclipse.app4mc.amalthea.validations.standard.tests/xtend-gen/org/eclipse/app4mc/amalthea/validations/standard/tests/EMFIntrinsicTests.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2018-2019 Robert Bosch GmbH and others.
+ * Copyright (c) 2018-2022 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,14 @@
import com.google.common.base.Objects;
import java.util.List;
import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import org.eclipse.app4mc.amalthea.model.ActivityGraph;
import org.eclipse.app4mc.amalthea.model.Amalthea;
+import org.eclipse.app4mc.amalthea.model.Label;
+import org.eclipse.app4mc.amalthea.model.LabelAccess;
+import org.eclipse.app4mc.amalthea.model.RunnableCall;
import org.eclipse.app4mc.amalthea.model.SWModel;
import org.eclipse.app4mc.amalthea.model.SporadicActivation;
import org.eclipse.app4mc.amalthea.model.TimeUnit;
@@ -83,12 +90,8 @@
return it.getMessage();
};
final Map<EObject, String> errors = IterableExtensions.<ValidationDiagnostic, EObject, String>toMap(IterableExtensions.<ValidationDiagnostic>filter(validationResult, _function_1), _function_2, _function_3);
- String _get = errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a1"));
- boolean _equals = Objects.equal(_get, "TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a1\" )");
- Assert.assertTrue(_equals);
- String _get_1 = errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a2"));
- boolean _equals_1 = Objects.equal(_get_1, "TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a2\" )");
- Assert.assertTrue(_equals_1);
+ Assert.assertEquals("TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a1\" )", errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a1")));
+ Assert.assertEquals("TimeBoundaries: lower bound > upper bound ( in Sporadic Activation \"a2\" )", errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a2")));
}
@Test
@@ -116,8 +119,59 @@
return it.getMessage();
};
final Map<EObject, String> errors = IterableExtensions.<ValidationDiagnostic, EObject, String>toMap(IterableExtensions.<ValidationDiagnostic>filter(validationResult, _function_1), _function_2, _function_3);
- String _get = errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a1"));
- boolean _equals = Objects.equal(_get, "TimeGaussDistribution: lower bound > upper bound ( in Sporadic Activation \"a1\" )");
- Assert.assertTrue(_equals);
+ Assert.assertEquals("TimeGaussDistribution: lower bound > upper bound ( in Sporadic Activation \"a1\" )", errors.get(this.b1.<SporadicActivation>_find(model, SporadicActivation.class, "a1")));
+ }
+
+ @Test
+ public void testMissingName() {
+ final Procedure1<Amalthea> _function = (Amalthea it) -> {
+ final Procedure1<SWModel> _function_1 = (SWModel it_1) -> {
+ final Procedure1<Label> _function_2 = (Label it_2) -> {
+ it_2.setDisplayName("l1");
+ it_2.setConstant(true);
+ };
+ this.b2.label(it_1, _function_2);
+ final Procedure1<Label> _function_3 = (Label it_2) -> {
+ it_2.setDisplayName("l2");
+ it_2.setConstant(true);
+ };
+ this.b2.label(it_1, _function_3);
+ final Procedure1<org.eclipse.app4mc.amalthea.model.Runnable> _function_4 = (org.eclipse.app4mc.amalthea.model.Runnable it_2) -> {
+ it_2.setName("run1");
+ final Procedure1<ActivityGraph> _function_5 = (ActivityGraph it_3) -> {
+ final Procedure1<LabelAccess> _function_6 = (LabelAccess it_4) -> {
+ };
+ this.b2.labelAccess(it_3, _function_6);
+ final Procedure1<LabelAccess> _function_7 = (LabelAccess it_4) -> {
+ };
+ this.b2.labelAccess(it_3, _function_7);
+ };
+ this.b2.activityGraph(it_2, _function_5);
+ };
+ this.b2.runnable(it_1, _function_4);
+ final Procedure1<org.eclipse.app4mc.amalthea.model.Runnable> _function_5 = (org.eclipse.app4mc.amalthea.model.Runnable it_2) -> {
+ it_2.setName("run2");
+ final Procedure1<ActivityGraph> _function_6 = (ActivityGraph it_3) -> {
+ final Procedure1<RunnableCall> _function_7 = (RunnableCall it_4) -> {
+ };
+ this.b2.runnableCall(it_3, _function_7);
+ };
+ this.b2.activityGraph(it_2, _function_6);
+ };
+ this.b2.runnable(it_1, _function_5);
+ };
+ this.b1.softwareModel(it, _function_1);
+ };
+ final Amalthea model = this.b1.amalthea(_function);
+ final List<ValidationDiagnostic> validationResult = this.runExecutor(model);
+ final Predicate<ValidationDiagnostic> _function_1 = (ValidationDiagnostic it) -> {
+ Severity _severityLevel = it.getSeverityLevel();
+ return Objects.equal(_severityLevel, Severity.ERROR);
+ };
+ final Function<ValidationDiagnostic, String> _function_2 = (ValidationDiagnostic it) -> {
+ return it.getMessage();
+ };
+ final List<String> errors = validationResult.stream().filter(_function_1).<String>map(_function_2).collect(Collectors.<String>toList());
+ Assert.assertEquals(5, errors.size());
}
}