Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2019-11-05 15:14:43 +0000
committervincent lorenzo2019-11-15 08:10:36 +0000
commitd159fd79d85c66ba619857283937d97618789a4e (patch)
tree70a86a2d0e80e8ed31de3f3704bed6f40664367d
parent1f44e7d33dfac0f00e47400753fbe0312e308bf6 (diff)
downloadorg.eclipse.papyrus-d159fd79d85c66ba619857283937d97618789a4e.tar.gz
org.eclipse.papyrus-d159fd79d85c66ba619857283937d97618789a4e.tar.xz
org.eclipse.papyrus-d159fd79d85c66ba619857283937d97618789a4e.zip
Bug 552697: [Tests][API] Xtext Tests classes must be distributed as API
Change-Id: I313800531f2f8997572605244fb663e5cfc62912 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF8
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml2
-rwxr-xr-x[-rw-r--r--]tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/AbstractGrammarTest.java (renamed from tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/AbstractGrammarTest.java)11
-rwxr-xr-x[-rw-r--r--]tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/XTextEditorTester.java (renamed from tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/XTextEditorTester.java)11
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF5
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml25
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java2
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/META-INF/MANIFEST.MF5
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml24
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/src/org/eclipse/papyrus/uml/textedit/port/tests/suites/PortGrammarTests.java24
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/META-INF/MANIFEST.MF5
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml25
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/src/org/eclipse/papyrus/uml/textedit/property/tests/suites/PropertyGrammarTests.java24
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/META-INF/MANIFEST.MF2
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF7
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml25
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityLowerValueSpecificationGrammarTests.java8
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityUpperValueSpecificationGrammarTests.java8
-rw-r--r--tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java32
19 files changed, 134 insertions, 119 deletions
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF b/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
index f656c54f629..dfbca949edc 100644
--- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
@@ -10,15 +10,17 @@ Require-Bundle: org.eclipse.jdt.ui;bundle-version="[3.12.0,4.0.0)";visibility:=r
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.nattable.common;bundle-version="[5.0.0,6.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.papyrus.infra.internationalization;bundle-version="[1.0.0,2.0.0)"
+ org.eclipse.papyrus.infra.internationalization;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.1.0,3.0.0)"
Export-Package: org.eclipse.papyrus.junit.matchers,
org.eclipse.papyrus.junit.utils,
org.eclipse.papyrus.junit.utils.resources,
org.eclipse.papyrus.junit.utils.rules,
- org.eclipse.papyrus.junit.utils.tests
+ org.eclipse.papyrus.junit.utils.tests,
+ org.eclipse.papyrus.junit.utils.xtext
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.junit.utils.Activator
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml b/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml
index 17bdd3a4fa9..7e9d984ee49 100644
--- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.papyrus</groupId>
<artifactId>org.eclipse.papyrus.junit.utils</artifactId>
- <version>2.3.0-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/AbstractGrammarTest.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/AbstractGrammarTest.java
index bb9332b8e27..bbf8f5db8bd 100644..100755
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/AbstractGrammarTest.java
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/AbstractGrammarTest.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014 CEA LIST
+ * Copyright (c) 2014, 2019 CEA LIST
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,10 +10,10 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - bug 552697
*****************************************************************************/
-package org.eclipse.papyrus.uml.textedit.tests;
+package org.eclipse.papyrus.junit.utils.xtext;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
@@ -26,6 +26,9 @@ import org.eclipse.uml2.uml.NamedElement;
import org.junit.Before;
import org.junit.Rule;
+/**
+ * @since 2.4
+ */
public abstract class AbstractGrammarTest<T extends EObject> extends AbstractPapyrusTest {
protected DefaultXtextDirectEditorConfiguration editor;
@@ -38,7 +41,7 @@ public abstract class AbstractGrammarTest<T extends EObject> extends AbstractPap
@Before
public void initEditor() {
editor = getEditor();
- tester = new XTextEditorTester<T>(editor);
+ tester = new XTextEditorTester<>(editor);
}
public <E extends NamedElement> E findElement(Class<E> type, String name) {
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/XTextEditorTester.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/XTextEditorTester.java
index 558652e3a58..c23b9653b93 100644..100755
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/src/org/eclipse/papyrus/uml/textedit/tests/XTextEditorTester.java
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/xtext/XTextEditorTester.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2014, 2018 CEA LIST
+ * Copyright (c) 2014, 2018, 2019 CEA LIST
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,10 +10,10 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Bug 539293
+ * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Bug 539293, Bug 552697
*
*****************************************************************************/
-package org.eclipse.papyrus.uml.textedit.tests;
+package org.eclipse.papyrus.junit.utils.xtext;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.ecore.EObject;
@@ -23,6 +23,9 @@ import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
+/**
+ * @since 2.4
+ */
public class XTextEditorTester<T extends EObject> {
/**
@@ -69,7 +72,7 @@ public class XTextEditorTester<T extends EObject> {
/**
*
* @return
- * the command result. This method must be called after the method parseText. If not, this method will return <code>null</code>;
+ * the command result. This method must be called after the method parseText. If not, this method will return <code>null</code>;
*
* @since 1.3
*/
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF
index fe446ebcdd1..5f9bbadf87b 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF
@@ -1,9 +1,8 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.uml.textedit.tests;bundle-version="[1.2.0,2.0.0)",
org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
- org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.utils;bundle-version="[2.4.0,3.0.0)",
org.junit;bundle-version="4.11.0",
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.uml.textedit.parameter.xtext.ui;bundle-version="[2.1.0,3.0.0)"
@@ -11,7 +10,7 @@ Export-Package: org.eclipse.papyrus.uml.textedit.parameter.tests,
org.eclipse.papyrus.uml.textedit.parameter.tests.suites
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.2.100.qualifier
Bundle-Name: UML Textedit Parameter Tests
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.textedit.parameter.tests.Activator
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml
index 6c60f66bfd6..d4131853e68 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
<groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.parameter.tests</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
+ <artifactId>org.eclipse.papyrus.uml.textedit.parameter.tests
+ </artifactId>
+ <version>1.2.100-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java
index 982e983abe6..88409c94d73 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java
@@ -16,8 +16,8 @@ package org.eclipse.papyrus.uml.textedit.parameter.tests.suites;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.parameter.xtext.ui.contributions.ParameterXtextDirectEditorConfiguration;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Component;
import org.eclipse.uml2.uml.DataType;
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/META-INF/MANIFEST.MF
index 3c1aea88fce..089538b35af 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/META-INF/MANIFEST.MF
@@ -1,16 +1,15 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.papyrus.uml.textedit.tests;bundle-version="[1.2.0,2.0.0)",
org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
org.junit;bundle-version="4.11.0",
- org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.utils;bundle-version="[2.4.0,3.0.0)",
org.eclipse.papyrus.uml.textedit.port.xtext.ui;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)"
Export-Package: org.eclipse.papyrus.uml.textedit.port.tests.suites
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.2.100.qualifier
Bundle-Name: XText Port Editor Tests
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.textedit.port.tests.Activator
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml
index 424aa55f506..234d300b3c7 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/pom.xml
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
<groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.port.tests</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
+ <artifactId>org.eclipse.papyrus.uml.textedit.port.tests</artifactId>
+ <version>1.2.100-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/src/org/eclipse/papyrus/uml/textedit/port/tests/suites/PortGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/src/org/eclipse/papyrus/uml/textedit/port/tests/suites/PortGrammarTests.java
index 5a0442fdc71..6a3533cdd0c 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/src/org/eclipse/papyrus/uml/textedit/port/tests/suites/PortGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.port.tests/src/org/eclipse/papyrus/uml/textedit/port/tests/suites/PortGrammarTests.java
@@ -15,8 +15,8 @@ package org.eclipse.papyrus.uml.textedit.port.tests.suites;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.port.xtext.ui.contribution.PortXtextDirectEditorConfiguration;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Component;
import org.eclipse.uml2.uml.DataType;
@@ -106,45 +106,45 @@ public class PortGrammarTests extends AbstractGrammarTest<Port> {
final LiteralInteger lowerBound = UMLFactory.eINSTANCE.createLiteralInteger();
lowerBound.setValue(2);
testedPort.setLowerValue(lowerBound);
-
+
final LiteralUnlimitedNatural upperBound = UMLFactory.eINSTANCE.createLiteralUnlimitedNatural();
upperBound.setValue(4);
testedPort.setUpperValue(upperBound);
-
+
Assert.assertEquals("+ p1 : <Undefined> [2..4] {unique}", tester.getInitialText(testedPort));
-
+
// Parse Integer and UnlimitedNatural
tester.parseText(testedPort, "p1 : <Undefined> [1..*] {unique}");
Assert.assertEquals("The instance of lower ValueSpecification should not change when compatible types are used", lowerBound, testedPort.getLowerValue());
Assert.assertEquals("The instance of upper ValueSpecification should not change when compatible types are used", upperBound, testedPort.getUpperValue());
Assert.assertEquals(1, lowerBound.getValue());
Assert.assertEquals(-1, upperBound.getValue());
-
+
// Manage only one bound display
lowerBound.setValue(0);
Assert.assertEquals("+ p1 : <Undefined> [*] {unique}", tester.getInitialText(testedPort));
-
+
// Parse one String
tester.parseText(testedPort, "p1 : <Undefined> [\"TEN\"] {unique}");
Assert.assertTrue("The created lower ValueSpecification must be a LiteralString", testedPort.getLowerValue() instanceof LiteralString);
Assert.assertTrue("The created upper ValueSpecification must be a LiteralString", testedPort.getUpperValue() instanceof LiteralString);
- Assert.assertEquals("TEN", ((LiteralString)testedPort.getLowerValue()).getValue());
- LiteralString upperStringBound = (LiteralString)testedPort.getUpperValue();
+ Assert.assertEquals("TEN", ((LiteralString) testedPort.getLowerValue()).getValue());
+ LiteralString upperStringBound = (LiteralString) testedPort.getUpperValue();
Assert.assertEquals("TEN", upperStringBound.getValue());
-
+
// Manage Integer and String
lowerBound.setValue(3);
testedPort.setLowerValue(lowerBound);
Assert.assertEquals("+ p1 : <Undefined> [3..\"TEN\"] {unique}", tester.getInitialText(testedPort));
-
+
// Parse Integer and String
tester.parseText(testedPort, "p1 : <Undefined> [\"MIN\"..\"MAX\"] {unique}");
Assert.assertTrue("The created lower ValueSpecification must be a LiteralString", testedPort.getLowerValue() instanceof LiteralString);
Assert.assertEquals("The instance of upper ValueSpecification should not change when compatible types are used", upperStringBound, testedPort.getUpperValue());
- Assert.assertEquals("MIN", ((LiteralString)testedPort.getLowerValue()).getValue());
+ Assert.assertEquals("MIN", ((LiteralString) testedPort.getLowerValue()).getValue());
Assert.assertEquals("MAX", upperStringBound.getValue());
}
-
+
@Override
public DefaultXtextDirectEditorConfiguration getEditor() {
return new PortXtextDirectEditorConfiguration();
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/META-INF/MANIFEST.MF
index 8314e7ece6b..93bc3a050e8 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/META-INF/MANIFEST.MF
@@ -2,18 +2,17 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)",
org.junit;bundle-version="4.11.0",
- org.eclipse.papyrus.uml.textedit.tests;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.uml.textedit.property.xtext.ui;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
org.eclipse.papyrus.uml.tools;bundle-version="[4.0.0,5.0.0)",
org.eclipse.papyrus.uml.tools.utils;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)"
+ org.eclipse.papyrus.junit.utils;bundle-version="[2.4.0,3.0.0)"
Export-Package: org.eclipse.papyrus.uml.textedit.property.tests.suites
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.100.qualifier
+Bundle-Version: 1.2.200.qualifier
Bundle-Name: XText Property editor Tests
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.textedit.property.tests.Activator
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml
index 5c1cc424808..1f38caaa754 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/pom.xml
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
<groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.property.tests</artifactId>
- <version>1.2.100-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
+ <artifactId>org.eclipse.papyrus.uml.textedit.property.tests
+ </artifactId>
+ <version>1.2.200-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/src/org/eclipse/papyrus/uml/textedit/property/tests/suites/PropertyGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/src/org/eclipse/papyrus/uml/textedit/property/tests/suites/PropertyGrammarTests.java
index 2489ec48034..785e163d837 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/src/org/eclipse/papyrus/uml/textedit/property/tests/suites/PropertyGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.property.tests/src/org/eclipse/papyrus/uml/textedit/property/tests/suites/PropertyGrammarTests.java
@@ -14,8 +14,8 @@
package org.eclipse.papyrus.uml.textedit.property.tests.suites;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.property.xtext.ui.contributions.PropertyXtextDirectEditorConfiguration;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Component;
import org.eclipse.uml2.uml.DataType;
@@ -92,49 +92,49 @@ public class PropertyGrammarTests extends AbstractGrammarTest<Property> {
Assert.assertEquals("The instance of ValueSpecification should not change when compatible types are used", defaultRealValue, testedProperty.getDefaultValue());
Assert.assertEquals(.2, defaultRealValue.getValue(), 0.001);
}
-
+
@Test
public void testMultiplicity() throws Exception {
// Manage two bounds (integer and unlimited natural) display
final LiteralInteger lowerBound = UMLFactory.eINSTANCE.createLiteralInteger();
lowerBound.setValue(2);
testedProperty.setLowerValue(lowerBound);
-
+
final LiteralUnlimitedNatural upperBound = UMLFactory.eINSTANCE.createLiteralUnlimitedNatural();
upperBound.setValue(4);
testedProperty.setUpperValue(upperBound);
-
+
Assert.assertEquals("+ p1 : <Undefined> [2..4] {unique}", tester.getInitialText(testedProperty));
-
+
// Parse Integer and UnlimitedNatural
tester.parseText(testedProperty, "p1 : <Undefined> [1..*] {unique}");
Assert.assertEquals("The instance of lower ValueSpecification should not change when compatible types are used", lowerBound, testedProperty.getLowerValue());
Assert.assertEquals("The instance of upper ValueSpecification should not change when compatible types are used", upperBound, testedProperty.getUpperValue());
Assert.assertEquals(1, lowerBound.getValue());
Assert.assertEquals(-1, upperBound.getValue());
-
+
// Manage only one bound display
lowerBound.setValue(0);
Assert.assertEquals("+ p1 : <Undefined> [*] {unique}", tester.getInitialText(testedProperty));
-
+
// Parse one String
tester.parseText(testedProperty, "p1 : <Undefined> [\"TEN\"] {unique}");
Assert.assertTrue("The created lower ValueSpecification must be a LiteralString", testedProperty.getLowerValue() instanceof LiteralString);
Assert.assertTrue("The created upper ValueSpecification must be a LiteralString", testedProperty.getUpperValue() instanceof LiteralString);
- Assert.assertEquals("TEN", ((LiteralString)testedProperty.getLowerValue()).getValue());
- LiteralString upperStringBound = (LiteralString)testedProperty.getUpperValue();
+ Assert.assertEquals("TEN", ((LiteralString) testedProperty.getLowerValue()).getValue());
+ LiteralString upperStringBound = (LiteralString) testedProperty.getUpperValue();
Assert.assertEquals("TEN", upperStringBound.getValue());
-
+
// Manage Integer and String
lowerBound.setValue(3);
testedProperty.setLowerValue(lowerBound);
Assert.assertEquals("+ p1 : <Undefined> [3..\"TEN\"] {unique}", tester.getInitialText(testedProperty));
-
+
// Parse Integer and String
tester.parseText(testedProperty, "p1 : <Undefined> [\"MIN\"..\"MAX\"] {unique}");
Assert.assertTrue("The created lower ValueSpecification must be a LiteralString", testedProperty.getLowerValue() instanceof LiteralString);
Assert.assertEquals("The instance of upper ValueSpecification should not change when compatible types are used", upperStringBound, testedProperty.getUpperValue());
- Assert.assertEquals("MIN", ((LiteralString)testedProperty.getLowerValue()).getValue());
+ Assert.assertEquals("MIN", ((LiteralString) testedProperty.getLowerValue()).getValue());
Assert.assertEquals("MAX", upperStringBound.getValue());
}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/META-INF/MANIFEST.MF
index bca24d4ec23..3d531fc3fe5 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.tests/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)",
org.junit;bundle-version="4.11.0",
org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.utils;bundle-version="[2.4.0,3.0.0)",
org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.gmfdiag.extensionpoints.editors;bundle-version="[1.0.0,2.0.0)"
Export-Package: org.eclipse.papyrus.uml.textedit.tests,
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF
index 2c9ecdbe638..6d52bdff056 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/META-INF/MANIFEST.MF
@@ -2,19 +2,18 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.uml2.uml;bundle-version="[5.3.0,6.0.0)",
org.junit;bundle-version="4.11.0",
- org.eclipse.papyrus.junit.utils;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.utils;bundle-version="[2.4.0,3.0.0)",
org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.junit.framework;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui;bundle-version="[2.1.0,3.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="[3.0.0,4.0.0)",
org.eclipse.gmf.runtime.common.ui.services,
org.eclipse.gmf.runtime.emf.core,
- org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.uml.textedit.tests;bundle-version="[1.2.0,2.0.0)"
+ org.eclipse.papyrus.infra.core;bundle-version="[3.0.0,4.0.0)"
Export-Package: org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.2.100.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.papyrus.uml.textedit.valuespecification.tests.Activator
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml
index 5ec7178bf9d..8be27de9528 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/pom.xml
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.uml.textedit.tests.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
<groupId>org.eclipse.papyrus.tests</groupId>
- <artifactId>org.eclipse.papyrus.uml.textedit.valuespecification.tests</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>eclipse-test-plugin</packaging>
+ <artifactId>org.eclipse.papyrus.uml.textedit.valuespecification.tests
+ </artifactId>
+ <version>1.2.100-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
</project>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityLowerValueSpecificationGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityLowerValueSpecificationGrammarTests.java
index 0ab773ef193..ab3178cee3c 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityLowerValueSpecificationGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityLowerValueSpecificationGrammarTests.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,14 @@
*
* Contributors:
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui.contribution.MultiplicityLowerValueSpecificationXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Class;
@@ -48,7 +48,7 @@ public class MultiplicityLowerValueSpecificationGrammarTests extends AbstractGra
rootModel = findElement(Model.class, "model");
final Class createdClass = (Class) rootModel.createPackagedElement("Class1", UMLPackage.eINSTANCE.getClass_());
- testedProperty = (Property) createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
+ testedProperty = createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
}
@Test
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityUpperValueSpecificationGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityUpperValueSpecificationGrammarTests.java
index 538af45fa1b..4b5368224fe 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityUpperValueSpecificationGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/MultiplicityUpperValueSpecificationGrammarTests.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,14 @@
*
* Contributors:
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui.contribution.MultiplicityUpperValueSpecificationXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Class;
@@ -48,7 +48,7 @@ public class MultiplicityUpperValueSpecificationGrammarTests extends AbstractGra
rootModel = findElement(Model.class, "model");
final Class createdClass = (Class) rootModel.createPackagedElement("Class1", UMLPackage.eINSTANCE.getClass_());
- testedProperty = (Property) createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
+ testedProperty = createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
}
@Test
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java
index 1a15a9470b6..6bea8c98139 100644
--- a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java
+++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.valuespecification.tests/src/org/eclipse/papyrus/uml/textedit/valuespecification/tests/suites/ValueSpecificationGrammarTests.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 CEA LIST.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
@@ -18,7 +18,7 @@ package org.eclipse.papyrus.uml.textedit.valuespecification.tests.suites;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
-import org.eclipse.papyrus.uml.textedit.tests.AbstractGrammarTest;
+import org.eclipse.papyrus.junit.utils.xtext.AbstractGrammarTest;
import org.eclipse.papyrus.uml.textedit.valuespecification.xtext.ui.contribution.ValueSpecificationXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Class;
@@ -88,7 +88,7 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
realType = findElement(Property.class, "PropertyRealType").getType();
Class createdClass = (Class) rootModel.createPackagedElement("Class1", UMLPackage.eINSTANCE.getClass_());
- testedProperty = (Property) createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
+ testedProperty = createdClass.createOwnedAttribute("Property", null, UMLPackage.eINSTANCE.getProperty());
}
@Test
@@ -101,7 +101,7 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
// Check undefined
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "<Undefined>");
Assert.assertNull(testedProperty.getDefaultValue());
-
+
// ***************************************************//
// Check the basic parser with all the possible types //
// ***************************************************//
@@ -133,7 +133,7 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural(), testedProperty.getDefaultValue().eClass());
Assert.assertEquals(34, ((LiteralUnlimitedNatural) testedProperty.getDefaultValue()).getValue());
-
+
// Check literal real
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "123.45");
Assert.assertEquals(VisibilityKind.PROTECTED_LITERAL, testedProperty.getDefaultValue().getVisibility());
@@ -146,7 +146,7 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
Assert.assertEquals(VisibilityKind.PUBLIC_LITERAL, testedProperty.getDefaultValue().getVisibility());
Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralNull(), testedProperty.getDefaultValue().eClass());
-
+
// Check return to null
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "");
Assert.assertEquals(null, testedProperty.getDefaultValue());
@@ -163,20 +163,20 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
Assert.assertEquals(VisibilityKind.PRIVATE_LITERAL, testedProperty.getDefaultValue().getVisibility());
Assert.assertEquals("+#id=\"test\"", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
-
+
// *********************************************//
// Check the update of same value specification //
// *********************************************//
-
+
// Check literal unlimited natural
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+unlimitedNatural=12");
Assert.assertEquals(VisibilityKind.PUBLIC_LITERAL, testedProperty.getDefaultValue().getVisibility());
Assert.assertEquals("unlimitedNatural", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralUnlimitedNatural(), testedProperty.getDefaultValue().eClass());
Assert.assertEquals(12, ((LiteralUnlimitedNatural) testedProperty.getDefaultValue()).getValue());
-
+
// Get the id of the default value to check that the default value is not created an other time
- final String currentIdentifier = ((XMIResource)testedProperty.getDefaultValue().eResource()).getID(testedProperty.getDefaultValue());
+ final String currentIdentifier = ((XMIResource) testedProperty.getDefaultValue().eResource()).getID(testedProperty.getDefaultValue());
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "34");
Assert.assertEquals(currentIdentifier, ((XMIResource) testedProperty.getDefaultValue().eResource()).getID(testedProperty.getDefaultValue()));
@@ -196,7 +196,7 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
Assert.assertEquals("unlimitedNatural", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralReal(), testedProperty.getDefaultValue().eClass());
Assert.assertEquals(12, ((LiteralReal) testedProperty.getDefaultValue()).getValue(), 0);
-
+
// Check the unlimited natural text parser with integer type on property -> Literal integer will be created
testedProperty.setType(integerType);
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "-integer=34");
@@ -204,13 +204,13 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
Assert.assertEquals("integer", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getLiteralInteger(), testedProperty.getDefaultValue().eClass());
Assert.assertEquals(34, ((LiteralInteger) testedProperty.getDefaultValue()).getValue(), 0);
-
+
// Check the integer text parser with boolean type on property -> Opaque Expression will be created
testedProperty.setType(booleanType);
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "+integer=56");
Assert.assertEquals("+integer=56", testedProperty.getDefaultValue().getName());
Assert.assertEquals(UMLPackage.eINSTANCE.getOpaqueExpression(), testedProperty.getDefaultValue().eClass());
-
+
// ******************************//
// Check the multi valued option //
// ******************************//
@@ -229,12 +229,12 @@ public class ValueSpecificationGrammarTests extends AbstractGrammarTest<EStructu
// Check the integer text parser with boolean type on property -> Opaque Expression will be created
tester.parseText(testedProperty, UMLPackage.Literals.PROPERTY__DEFAULT_VALUE, "");
Assert.assertNull(testedProperty.getDefaultValue());
-
+
}
@Test
public void testInitialText() {
- ValueSpecification testedValueSpecification = (ValueSpecification) testedProperty.createDefaultValue("valueSpec", null, UMLPackage.eINSTANCE.getLiteralBoolean());
+ ValueSpecification testedValueSpecification = testedProperty.createDefaultValue("valueSpec", null, UMLPackage.eINSTANCE.getLiteralBoolean());
Assert.assertEquals("valueSpec=false", tester.getParentInitialText(testedValueSpecification));
((LiteralBoolean) testedValueSpecification).setValue(true);

Back to the top