[514353] Failing test case
diff --git a/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/UMLValidateTest.java b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/UMLValidateTest.java
index 0c840ae..afa82fd 100644
--- a/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/UMLValidateTest.java
+++ b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/UMLValidateTest.java
@@ -824,4 +824,25 @@
assertUMLOCLValidationDiagnostics(ocl, "UML Load", umlResource);
ocl.dispose();
}
+
+ public void test_umlValidation_Bug514353() throws IOException {
+ resetRegistries();
+ CommonOptions.DEFAULT_DELEGATION_MODE.setDefaultValue(PivotConstants.OCL_DELEGATE_URI_PIVOT);
+ if (EcorePlugin.IS_ECLIPSE_RUNNING) {
+ new CommonPreferenceInitializer().initializeDefaultPreferences();
+ }
+ OCL ocl = createOCL();
+ ResourceSet resourceSet = ocl.getResourceSet();
+ org.eclipse.ocl.ecore.delegate.OCLDelegateDomain.initialize(resourceSet);
+ OCLDelegateDomain.initializePivotOnlyDiagnosticianResourceSet(resourceSet);
+ @SuppressWarnings("null")@NonNull Resource umlResource = doLoadUML(ocl, "Bug514353");
+ assertNoResourceErrors("Loading", umlResource);
+ Map<Object, Object> validationContext = LabelUtil.createDefaultContext(Diagnostician.INSTANCE);
+ OCLDelegateDomain.initializePivotOnlyDiagnosticianContext(validationContext);
+ assertValidationDiagnostics("Loading", umlResource, validationContext);
+ assertUMLOCLValidationDiagnostics(ocl, "UML Load", umlResource/*,
+ "\"Parsing error for RootElement::Class1::Attribute1::class2.Attribute1 + 1.0:\n" +
+ " Failed to load 'file:/E:/GIT/org.eclipse.ocl/tests/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/pivot/tests/models/Bug514353.uml.oclas' : Unsupported Class::nestedClassifiers for \"Class1\" in UML2ASDeclarationSwitch\""*/);
+ ocl.dispose();
+ }
}
diff --git a/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/models/Bug514353.uml b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/models/Bug514353.uml
new file mode 100644
index 0000000..d9c525f
--- /dev/null
+++ b/tests/org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/pivot/tests/models/Bug514353.uml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_M6oY8BPqEeeYG4XOVuuZwg" name="RootElement" URI="http://Bug514353">
+ <packageImport xmi:id="_NBTosBPqEeeYG4XOVuuZwg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_Pcw-gBPqEeeYG4XOVuuZwg" name="Class1">
+ <ownedAttribute xmi:id="_SBNRMBPqEeeYG4XOVuuZwg" name="Attribute1" isDerived="true">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ <defaultValue xmi:type="uml:OpaqueExpression" xmi:id="_f9T_sBPqEeeYG4XOVuuZwg">
+ <language>OCL</language>
+ <body>class2.Attribute1 + 1.0</body>
+ </defaultValue>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="_WceioBPqEeeYG4XOVuuZwg" name="class2" type="_PyCq8BPqEeeYG4XOVuuZwg" aggregation="composite" association="_WcYcABPqEeeYG4XOVuuZwg"/>
+ <nestedClassifier xmi:type="uml:Association" xmi:id="_WcYcABPqEeeYG4XOVuuZwg" memberEnd="_WceioBPqEeeYG4XOVuuZwg _WciNABPqEeeYG4XOVuuZwg">
+ <eAnnotations xmi:id="_WcctcBPqEeeYG4XOVuuZwg" source="org.eclipse.papyrus">
+ <details xmi:id="_WcdUgBPqEeeYG4XOVuuZwg" key="nature" value="UML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:id="_WciNABPqEeeYG4XOVuuZwg" name="class1" type="_Pcw-gBPqEeeYG4XOVuuZwg" association="_WcYcABPqEeeYG4XOVuuZwg"/>
+ </nestedClassifier>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_PyCq8BPqEeeYG4XOVuuZwg" name="Class2">
+ <ownedAttribute xmi:id="_RdmN0BPqEeeYG4XOVuuZwg" name="Attribute1">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedAttribute>
+ </packagedElement>
+</uml:Model>