Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java4
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/launch/Bug424513.launch20
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java17
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.atl3
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore6
-rw-r--r--tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.emftvmbin0 -> 376 bytes
6 files changed, 48 insertions, 2 deletions
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java
index 2f38f82a..73e4aa55 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/util/OCLOperations.java
@@ -312,8 +312,8 @@ public final class OCLOperations {
public Object execute(final StackFrame frame) {
final Object o = frame.getLocal(0, 0);
final EClassifier type = (EClassifier)frame.getLocal(0, 1);
- if (type instanceof EClass && o instanceof EObject) {
- return ((EObject) o).eClass() == type;
+ if (type instanceof EClass) {
+ return o instanceof EObject && ((EObject) o).eClass() == type;
} else if (o != null) {
final Class<?> ic = ((EClassifier)type).getInstanceClass();
if (ic == null) {
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/launch/Bug424513.launch b/tests/org.eclipse.m2m.atl.emftvm.tests/launch/Bug424513.launch
new file mode 100644
index 00000000..20758200
--- /dev/null
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/launch/Bug424513.launch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.m2m.atl.emftvm.launcher.EMFTVMTransformation">
+<stringAttribute key="ATL File Name" value="//org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.atl"/>
+<booleanAttribute key="Disable JIT compiler" value="false"/>
+<booleanAttribute key="Display Timing Data" value="true"/>
+<mapAttribute key="Inout Model Options"/>
+<mapAttribute key="Inout Models"/>
+<mapAttribute key="Inout Models Output Locations"/>
+<mapAttribute key="Input Model Options"/>
+<mapAttribute key="Input Models"/>
+<mapAttribute key="Metamodel Options"/>
+<mapAttribute key="Metamodels">
+<mapEntry key="MM" value="platform:/resource/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore"/>
+</mapAttribute>
+<stringAttribute key="Module Name" value="Regression::Bug424513"/>
+<stringAttribute key="Module Path" value="/org.eclipse.m2m.atl.emftvm.tests/test-data/"/>
+<mapAttribute key="Output Model Options"/>
+<mapAttribute key="Output Models"/>
+<listAttribute key="Superimpose"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
index 296d7624..98dc298d 100644
--- a/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/src/org/eclipse/m2m/atl/emftvm/tests/integration/IntegrationTest.java
@@ -223,4 +223,21 @@ public class IntegrationTest extends EMFTVMTest {
assertEquals(refOut.getResource(), out.getResource());
}
+ /**
+ * Tests regression of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=424513">Bug # 424513</a>.
+ */
+ public void testBug424513() {
+ final ResourceSet rs = new ResourceSetImpl();
+ final ExecEnv env = EmftvmFactory.eINSTANCE.createExecEnv();
+ final TimingData td = new TimingData();
+ final Metamodel mm = loadTestMetamodel(rs, "/test-data/Regression/Bug424513.ecore");
+ env.registerMetaModel("MM", mm);
+ env.loadModule(createTestModuleResolver(), "Regression::Bug424513");
+ td.finishLoading();
+ final Object result = env.run(td);
+ td.finish();
+
+ assertEquals(Boolean.FALSE, result);
+ }
+
}
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.atl b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.atl
new file mode 100644
index 00000000..efb8b005
--- /dev/null
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.atl
@@ -0,0 +1,3 @@
+-- @atlcompiler emftvm
+-- @path MM=/org.eclipse.m2m.atl.emftvm.tests/ttestt-data/Regression/Bug424513.ecore
+query "Regression::Bug424513" = 'something'.oclIsTypeOf(MM!DynamicClass); \ No newline at end of file
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore
new file mode 100644
index 00000000..f682bb60
--- /dev/null
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Bug424513" nsURI="platform:/plugin/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.ecore"
+ nsPrefix="Bug424513">
+ <eClassifiers xsi:type="ecore:EClass" name="DynamicClass"/>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.emftvm b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.emftvm
new file mode 100644
index 00000000..9b799d52
--- /dev/null
+++ b/tests/org.eclipse.m2m.atl.emftvm.tests/test-data/Regression/Bug424513.emftvm
Binary files differ

Back to the top