Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo SBH2016-10-18 12:18:39 +0000
committerEd Willink2016-10-22 14:16:36 +0000
commit4e04c5e16dd93c195f43c792b1360baadc40f4c7 (patch)
treefaf32c0b072f290d309c6213b018bb0c4086e30e
parent9592c1db923f710fdfa75b68d244d4a5cb998f93 (diff)
downloadorg.eclipse.qvtd-4e04c5e16dd93c195f43c792b1360baadc40f4c7.tar.gz
org.eclipse.qvtd-4e04c5e16dd93c195f43c792b1360baadc40f4c7.tar.xz
org.eclipse.qvtd-4e04c5e16dd93c195f43c792b1360baadc40f4c7.zip
[cs2as] - Adding MiniOCL tests to the tests suite
-rw-r--r--tests/org.eclipse.qvtd.all.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/AllQVTdTests.java2
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/MiniOCLCSParsingTest.launch30
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSInjectorProvider.java (renamed from tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/tests/MiniOCLCSInjectorProvider.java)2
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.xtend (renamed from tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/tests/MiniOCLCSParsingTest.xtend)11
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.MiniOCLCSParsingTest.xtendbinbin0 -> 3286 bytes
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.gitignore1
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.java114
-rw-r--r--tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/tests/.gitignore3
10 files changed, 142 insertions, 26 deletions
diff --git a/tests/org.eclipse.qvtd.all.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.qvtd.all.tests/META-INF/MANIFEST.MF
index 17bdb0d07..d911405aa 100644
--- a/tests/org.eclipse.qvtd.all.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.qvtd.all.tests/META-INF/MANIFEST.MF
@@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.qvtd.xtext.qvtrelation.tests;bundle-version="[0.14.0,1.0.0)",
org.eclipse.qvtd.cs2as.compiler.tests;bundle-version="[0.14.0,1.0.0)",
org.eclipse.qvtd.doc.exe2016.tests,
- org.eclipse.qvtd.doc.bigmde2016.tests
+ org.eclipse.qvtd.doc.bigmde2016.tests,
+ org.eclipse.qvtd.doc.minioclcs.xtext.tests
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/AllQVTdTests.java b/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/AllQVTdTests.java
index dfbdce4d9..2d48f8535 100644
--- a/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/AllQVTdTests.java
+++ b/tests/org.eclipse.qvtd.all.tests/src/org/eclipse/qvtd/all/tests/AllQVTdTests.java
@@ -19,6 +19,7 @@ import org.eclipse.qvtd.cs2as.compiler.tests.OCL2QVTiTestCases;
import org.eclipse.qvtd.doc.bigmde2016.tests.qvtc.BigMDE2016_QVTc_AutomatedTests;
import org.eclipse.qvtd.doc.exe2016.tests.qvtc.EXE2016_QVTc_AutomatedTests;
import org.eclipse.qvtd.doc.exe2016.tests.qvtr.EXE2016_QVTr_AutomatedTests;
+import org.eclipse.qvtd.doc.minioclcs.xtext.tests.MiniOCLCSParsingTest;
import org.eclipse.qvtd.xtext.qvtbase.tests.QVTbaseLibraryTests;
import org.eclipse.qvtd.xtext.qvtcore.tests.AllQVTcoreTests;
import org.eclipse.qvtd.xtext.qvtimperative.tests.AllQVTimperativeTests;
@@ -60,6 +61,7 @@ public class AllQVTdTests extends TestCase
result.addTestSuite(BigMDE2016_QVTc_AutomatedTests.class); // NB this is very slow since we are -ea
result.addTestSuite(EXE2016_QVTc_AutomatedTests.class); // NB this is very slow since we are -ea
result.addTestSuite(EXE2016_QVTr_AutomatedTests.class); // NB this is very slow since we are -ea
+ result.addTestSuite(MiniOCLCSParsingTest.class);
return result;
}
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/META-INF/MANIFEST.MF
index d351fd63a..84d07de79 100644
--- a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.qvtd.doc.miniocl;bundle-version="0.13.0",
org.eclipse.xtext.xbase.junit,
org.eclipse.xtext.xbase.lib
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Export-Package: org.eclipse.qvtd.doc.tests
+Export-Package: org.eclipse.qvtd.doc.minioclcs.xtext.tests
Import-Package: org.hamcrest.core,
org.junit;version="4.5.0",
org.junit.runners.model;version="4.5.0",
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/MiniOCLCSParsingTest.launch b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/MiniOCLCSParsingTest.launch
index c78c323e9..b7ce04327 100644
--- a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/MiniOCLCSParsingTest.launch
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/MiniOCLCSParsingTest.launch
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/tests/MiniOCLCSParsingTest.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.qvtd.doc.tests.MiniOCLCSParsingTest"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.qvtd.doc.minioclcs.xtext.tests"/>
-</launchConfiguration>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.qvtd.doc.minioclcs.xtext.tests"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.qvtd.doc.minioclcs.xtext.tests.MiniOCLCSParsingTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.qvtd.doc.minioclcs.xtext.tests"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/tests/MiniOCLCSInjectorProvider.java b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSInjectorProvider.java
index 145ce3139..53e6a212d 100644
--- a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/tests/MiniOCLCSInjectorProvider.java
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSInjectorProvider.java
@@ -1,7 +1,7 @@
/*
* generated by Xtext 2.10.0
*/
-package org.eclipse.qvtd.doc.tests;
+package org.eclipse.qvtd.doc.minioclcs.xtext.tests;
import com.google.inject.Guice;
import com.google.inject.Injector;
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/tests/MiniOCLCSParsingTest.xtend b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.xtend
index 519eb1ef9..502e067ea 100644
--- a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/tests/MiniOCLCSParsingTest.xtend
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/src/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.xtend
@@ -1,7 +1,7 @@
/*
* generated by Xtext 2.10.0-SNAPSHOT
*/
-package org.eclipse.qvtd.doc.tests
+package org.eclipse.qvtd.doc.minioclcs.xtext.tests
import com.google.inject.Inject
import org.eclipse.xtext.junit4.InjectWith
@@ -11,16 +11,17 @@ import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.eclipse.qvtd.doc.minioclcs.RootCS
+import junit.framework.TestCase
@RunWith(XtextRunner)
@InjectWith(MiniOCLCSInjectorProvider)
-class MiniOCLCSParsingTest{
+class MiniOCLCSParsingTest extends TestCase {
@Inject
ParseHelper<RootCS> parseHelper
@Test
- def void testSimpleMiniOCL() {
+ def void testSimpleMiniOCL_PackagesDef() {
val result = parseHelper.parse('''
package ocl {
@@ -39,8 +40,8 @@ class MiniOCLCSParsingTest{
Assert.assertNotNull(result)
}
- //@Test
- def void test() {
+ @Test
+ def void testSimpleMiniOCL_Invariant() {
val result = parseHelper.parse('''
package package1 {
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.MiniOCLCSParsingTest.xtendbin b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.MiniOCLCSParsingTest.xtendbin
new file mode 100644
index 000000000..8919ddde6
--- /dev/null
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.MiniOCLCSParsingTest.xtendbin
Binary files differ
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.gitignore b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.gitignore
new file mode 100644
index 000000000..2226a607e
--- /dev/null
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/.gitignore
@@ -0,0 +1 @@
+/.MiniOCLCSParsingTest.java._trace
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.java b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.java
new file mode 100644
index 000000000..71cc80c46
--- /dev/null
+++ b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/minioclcs/xtext/tests/MiniOCLCSParsingTest.java
@@ -0,0 +1,114 @@
+/**
+ * generated by Xtext 2.10.0-SNAPSHOT
+ */
+package org.eclipse.qvtd.doc.minioclcs.xtext.tests;
+
+import com.google.inject.Inject;
+import junit.framework.TestCase;
+import org.eclipse.qvtd.doc.minioclcs.RootCS;
+import org.eclipse.qvtd.doc.minioclcs.xtext.tests.MiniOCLCSInjectorProvider;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.XtextRunner;
+import org.eclipse.xtext.junit4.util.ParseHelper;
+import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(XtextRunner.class)
+@InjectWith(MiniOCLCSInjectorProvider.class)
+@SuppressWarnings("all")
+public class MiniOCLCSParsingTest extends TestCase {
+ @Inject
+ private ParseHelper<RootCS> parseHelper;
+
+ @Test
+ public void testSimpleMiniOCL_PackagesDef() {
+ try {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("package ocl {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("class String {}");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("package package1 {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("class c1 {\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("prop a : ocl::String;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("op getA() : ocl::String = a;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ final RootCS result = this.parseHelper.parse(_builder);
+ Assert.assertNotNull(result);
+ } catch (Throwable _e) {
+ throw Exceptions.sneakyThrow(_e);
+ }
+ }
+
+ @Test
+ public void testSimpleMiniOCL_Invariant() {
+ try {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("package package1 {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("class c1 {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("prop a : String;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("op giveMeA() : String = self.c1;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("op testA() : Boolean = giveMeA().size() <> 0; ");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("context package1::c1 {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("inv : a = giveMeA();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("inv : testA();");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ final RootCS result = this.parseHelper.parse(_builder);
+ Assert.assertNotNull(result);
+ } catch (Throwable _e) {
+ throw Exceptions.sneakyThrow(_e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/tests/.gitignore b/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/tests/.gitignore
deleted file mode 100644
index 34692069c..000000000
--- a/tests/org.eclipse.qvtd.doc.minioclcs.xtext.tests/xtend-gen/org/eclipse/qvtd/doc/tests/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/.MiniOCLCSParsingTest.java._trace
-/.MiniOCLCSParsingTest.xtendbin
-/MiniOCLCSParsingTest.java

Back to the top