summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Efftinge2011-09-05 13:51:04 (EDT)
committerEd Merks2011-09-05 13:51:04 (EDT)
commit960c06952354d4a1e0b176a5a9ee7c707ce09387 (patch)
treeafef1af90298e87dc4be9e139c1aaf61d29b355c
parentaa07b7476432f6e10290ab73513de1ea14b5e0b8 (diff)
downloadorg.eclipse.emf-960c06952354d4a1e0b176a5a9ee7c707ce09387.zip
org.eclipse.emf-960c06952354d4a1e0b176a5a9ee7c707ce09387.tar.gz
org.eclipse.emf-960c06952354d4a1e0b176a5a9ee7c707ce09387.tar.bz2
added a first version of a smoke test (fails)
-rw-r--r--org.eclipse.emf.ecore.xcore.tests/src/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.xtend44
-rw-r--r--org.eclipse.emf.ecore.xcore.tests/xtend-gen/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.java58
2 files changed, 102 insertions, 0 deletions
diff --git a/org.eclipse.emf.ecore.xcore.tests/src/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.xtend b/org.eclipse.emf.ecore.xcore.tests/src/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.xtend
new file mode 100644
index 0000000..afd44f0
--- /dev/null
+++ b/org.eclipse.emf.ecore.xcore.tests/src/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.xtend
@@ -0,0 +1,44 @@
+package org.eclipse.emf.ecore.xcore.tests.smoketest
+
+import org.eclipse.xtext.junit4.smoketest.AbstractSmokeTest
+import org.eclipse.xtext.linking.lazy.LazyLinkingResource
+import com.google.inject.Inject
+import org.eclipse.xtext.junit.util.ParseHelper
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.xtext.junit.validation.ValidationTestHelper
+import org.eclipse.xtext.junit4.XtextRunner
+import org.junit.runner.RunWith
+import org.eclipse.xtext.junit4.InjectWith
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider
+
+@RunWith(typeof(XtextRunner))
+@InjectWith(typeof(XcoreInjectorProvider))
+class XcoreSmokeTest extends AbstractSmokeTest {
+
+ @Inject extension ParseHelper<EObject> parser
+ @Inject extension ValidationTestHelper validationTestHelper
+
+ /**
+ * The models don't neccessarily need to be proper Xcore models.
+ */
+ override Iterable<String> getSmokeTestModels() {
+ newArrayList('''
+ package foo
+ class Stuff {
+ String x
+ contains Person p
+ }
+ '''.toString)
+ }
+
+ override void processModel(String model) {
+ model.parse.validate
+ }
+
+ override void processModelWithoutResourceSet(String model) {
+
+ }
+ override LazyLinkingResource createResource(String string) {
+
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.emf.ecore.xcore.tests/xtend-gen/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.java b/org.eclipse.emf.ecore.xcore.tests/xtend-gen/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.java
new file mode 100644
index 0000000..796ad4b
--- /dev/null
+++ b/org.eclipse.emf.ecore.xcore.tests/xtend-gen/org/eclipse/emf/ecore/xcore/tests/smoketest/XcoreSmokeTest.java
@@ -0,0 +1,58 @@
+package org.eclipse.emf.ecore.xcore.tests.smoketest;
+
+import com.google.inject.Inject;
+import java.util.ArrayList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.xcore.XcoreInjectorProvider;
+import org.eclipse.xtext.junit.util.ParseHelper;
+import org.eclipse.xtext.junit.validation.ValidationTestHelper;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.XtextRunner;
+import org.eclipse.xtext.junit4.smoketest.AbstractSmokeTest;
+import org.eclipse.xtext.linking.lazy.LazyLinkingResource;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xtend2.lib.StringConcatenation;
+import org.junit.runner.RunWith;
+
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(XcoreInjectorProvider.class)
+public class XcoreSmokeTest extends AbstractSmokeTest {
+
+ @Inject
+ private ParseHelper<EObject> parser;
+
+ @Inject
+ private ValidationTestHelper validationTestHelper;
+
+ public Iterable<String> getSmokeTestModels() {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("package foo ");
+ _builder.newLine();
+ _builder.append("class Stuff {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("String x");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("contains Person p");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ String _string = _builder.toString();
+ ArrayList<String> _newArrayList = CollectionLiterals.<String>newArrayList(_string);
+ return _newArrayList;
+ }
+
+ public void processModel(final String model) throws Exception {
+ EObject _parse = this.parser.parse(model);
+ this.validationTestHelper.validate(_parse);
+ }
+
+ public void processModelWithoutResourceSet(final String model) {
+ }
+
+ public LazyLinkingResource createResource(final String string) {
+ return null;
+ }
+} \ No newline at end of file