summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhubner2009-02-04 11:11:41 (EST)
committerdhubner2009-02-04 11:11:41 (EST)
commit3b9fb0ccecb723901f4c016805468cf019036b98 (patch)
tree35b848b44d8ee17b25eed3019e7454bb1367768d
parentb753783110cb8cab4c654b0b0262a7f49b9bdaae (diff)
downloadorg.eclipse.xpand-3b9fb0ccecb723901f4c016805468cf019036b98.zip
org.eclipse.xpand-3b9fb0ccecb723901f4c016805468cf019036b98.tar.gz
org.eclipse.xpand-3b9fb0ccecb723901f4c016805468cf019036b98.tar.bz2
activating xtend+emf.ts tests
-rw-r--r--plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/AllTests.java7
-rw-r--r--tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/AllAllTests.java1
-rw-r--r--tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/EmfMetaModelTest.java27
-rw-r--r--tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/PluginTests.java55
-rw-r--r--tests/org.eclipse.xtend.typesystem.emf.tests/test.xml4
5 files changed, 62 insertions, 32 deletions
diff --git a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/AllTests.java b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/AllTests.java
index f77f68d..baa3b58 100644
--- a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/AllTests.java
+++ b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/AllTests.java
@@ -17,10 +17,11 @@ public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.xtend.typesystem.emf.check");
- //$JUnit-BEGIN$
- suite.addTestSuite(OawValidatorPluginTests.class);
+ // $JUnit-BEGIN$
+ // TODO create an plugin test suit and put this test in
+ // suite.addTestSuite(OawValidatorPluginTests.class);
suite.addTestSuite(OawValidatorStandaloneTests.class);
- //$JUnit-END$
+ // $JUnit-END$
return suite;
}
diff --git a/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/AllAllTests.java b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/AllAllTests.java
index 1444c9a..b8840f5 100644
--- a/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/AllAllTests.java
+++ b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/AllAllTests.java
@@ -8,6 +8,7 @@ public class AllAllTests{
public static Test suite() {
TestSuite suite = new TestSuite("All Test for org.eclipse.xtend.typesystem.emf");
suite.addTest(AllTests.suite());
+ suite.addTestSuite(PluginTests.class);
return suite;
}
}
diff --git a/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/EmfMetaModelTest.java b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/EmfMetaModelTest.java
index 307f6b8..6a6458a 100644
--- a/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/EmfMetaModelTest.java
+++ b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/EmfMetaModelTest.java
@@ -11,12 +11,8 @@
package org.eclipse.xtend.typesystem.emf;
-import java.io.IOException;
-import java.util.Collections;
-
import junit.framework.TestCase;
-import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
@@ -25,10 +21,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.mwe.utils.StandaloneSetup;
import org.eclipse.xtend.expression.ExecutionContextImpl;
import org.eclipse.xtend.typesystem.Operation;
@@ -134,25 +126,6 @@ public class EmfMetaModelTest extends TestCase {
assertNotNull(ctx.getTypeForName("ecore::EOperation"));
}
- public final void testLoadMetaModelFile() throws IOException {
- final ExecutionContextImpl ctx = new ExecutionContextImpl();
- registerEPackagesOfModel("org.eclipse.xtend.typesystem.emf.tests/metamodels/subdir/model.xmi");
- EmfRegistryMetaModel mm = new EmfRegistryMetaModel();
- ctx.registerMetaModel(mm);
- // assertNotNull(ctx.getTypeForName("base::BaseType"));
- assertNotNull(ctx.getTypeForName("referee::SubAndReferring"));
- assertNotNull(ctx.getTypeForName("ecore::EClass"));
- assertNotNull(ctx.getTypeForName("nested::SubA"));
-
- }
- private void registerEPackagesOfModel(String string) throws IOException {
- ResourceSet rs = new ResourceSetImpl();
- Resource r = rs.createResource(URI
- .createPlatformPluginURI(string, true));
- r.load(Collections.EMPTY_MAP);
- EcoreUtil.resolveAll(rs);
- EPackage.Registry.INSTANCE.putAll(rs.getPackageRegistry());
- }
}
diff --git a/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/PluginTests.java b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/PluginTests.java
new file mode 100644
index 0000000..520178d
--- /dev/null
+++ b/tests/org.eclipse.xtend.typesystem.emf.tests/src/org/eclipse/xtend/typesystem/emf/PluginTests.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+package org.eclipse.xtend.typesystem.emf;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import junit.framework.TestCase;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.mwe.utils.StandaloneSetup;
+import org.eclipse.xtend.expression.ExecutionContextImpl;
+
+/**
+ * @author Dennis Hübner - Initial contribution and API
+ *
+ */
+public class PluginTests extends TestCase {
+ @Override
+ protected void setUp() throws Exception {
+ new StandaloneSetup().setPlatformUri("..");
+ }
+
+ public final void testLoadMetaModelFile() throws IOException {
+ final ExecutionContextImpl ctx = new ExecutionContextImpl();
+ registerEPackagesOfModel("org.eclipse.xtend.typesystem.emf.tests/metamodels/subdir/model.xmi");
+ EmfRegistryMetaModel mm = new EmfRegistryMetaModel();
+ ctx.registerMetaModel(mm);
+ // assertNotNull(ctx.getTypeForName("base::BaseType"));
+ assertNotNull(ctx.getTypeForName("referee::SubAndReferring"));
+ assertNotNull(ctx.getTypeForName("ecore::EClass"));
+ assertNotNull(ctx.getTypeForName("nested::SubA"));
+
+ }
+
+ private void registerEPackagesOfModel(String string) throws IOException {
+ ResourceSet rs = new ResourceSetImpl();
+ Resource r = rs.createResource(URI.createPlatformPluginURI(string, true));
+ r.load(Collections.EMPTY_MAP);
+ EcoreUtil.resolveAll(rs);
+ EPackage.Registry.INSTANCE.putAll(rs.getPackageRegistry());
+ }
+
+}
diff --git a/tests/org.eclipse.xtend.typesystem.emf.tests/test.xml b/tests/org.eclipse.xtend.typesystem.emf.tests/test.xml
index 49e3560..7370a90 100644
--- a/tests/org.eclipse.xtend.typesystem.emf.tests/test.xml
+++ b/tests/org.eclipse.xtend.typesystem.emf.tests/test.xml
@@ -14,7 +14,7 @@
*
* </copyright>
*
- * $Id: test.xml,v 1.3 2008/01/09 19:21:13 bkolb Exp $
+ * $Id: test.xml,v 1.4 2009/02/04 16:11:41 dhubner Exp $
*/
-->
@@ -44,7 +44,7 @@
<ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="data-dir" value="${emft-folder}"/>
<property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.xtend.typesystem.emf.AllAllTests"/>
+ <property name="classname" value="org.eclipse.xtend.typesystem.emf.AllTests"/>
</ant>
</target>