diff options
author | Camille Letavernier | 2014-10-23 14:33:44 +0000 |
---|---|---|
committer | Camille Letavernier | 2014-10-23 14:34:21 +0000 |
commit | 4eb2ce17c5c2d241a601e23c85220cfabd6e3ed0 (patch) | |
tree | 885435dab5d57a280ebeaef87f9c0e94098a5705 /tests/junit/plugins/uml/textedit | |
parent | 0671649ee95943f36bbc08df14bcf0c490cd64b1 (diff) | |
download | org.eclipse.papyrus-4eb2ce17c5c2d241a601e23c85220cfabd6e3ed0.tar.gz org.eclipse.papyrus-4eb2ce17c5c2d241a601e23c85220cfabd6e3ed0.tar.xz org.eclipse.papyrus-4eb2ce17c5c2d241a601e23c85220cfabd6e3ed0.zip |
448385: [XText Editors] Embedded editors must be tested
https://bugs.eclipse.org/bugs/show_bug.cgi?id=448385
- Add test plug-in for Parameters grammar
Diffstat (limited to 'tests/junit/plugins/uml/textedit')
14 files changed, 451 insertions, 0 deletions
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.classpath b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.classpath new file mode 100644 index 00000000000..8a8f1668cdc --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.project b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.project new file mode 100644 index 00000000000..e553de260d3 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.textedit.parameter.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f287d53cf45 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
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 new file mode 100644 index 00000000000..745843b7983 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: UML Textedit Parameter Tests +Bundle-SymbolicName: org.eclipse.papyrus.uml.textedit.parameter.tests +Bundle-Version: 1.1.0.qualifier +Bundle-Activator: org.eclipse.papyrus.uml.textedit.parameter.tests.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.papyrus.uml.xtext.integration.ui;bundle-version="1.1.0", + org.eclipse.papyrus.uml.textedit.tests;bundle-version="1.1.0", + org.eclipse.uml2.uml;bundle-version="5.0.0", + org.eclipse.papyrus.junit.utils;bundle-version="1.1.0", + org.junit;bundle-version="4.11.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.1.0", + org.eclipse.papyrus.uml.textedit.parameter.xtext.ui;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/ParameterGrammarTest.launch b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/ParameterGrammarTest.launch new file mode 100644 index 00000000000..f09f73f8dcf --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/ParameterGrammarTest.launch @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.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"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.uml.textedit.parameter.tests.suites.ParameterGrammarTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.uml.textedit.parameter.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx2048m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/about.html b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/about.html new file mode 100644 index 00000000000..35b45e096ae --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>September 30, 2009</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/build.properties b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/build.properties new file mode 100644 index 00000000000..e2306275b30 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/build.properties @@ -0,0 +1,7 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ model/,\
+ about.html
+src.includes = about.html
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.di b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.di new file mode 100644 index 00000000000..8634d4c00e0 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.notation b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.notation new file mode 100644 index 00000000000..bb4f8ce7e96 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.notation @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_ARn8UFn0EeS6Qb3CQxLHEQ" type="CompositeStructure" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_Jc1usFn0EeS6Qb3CQxLHEQ" type="2069">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Jc1usln0EeS6Qb3CQxLHEQ" type="5121"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Jc1us1n0EeS6Qb3CQxLHEQ" type="7069">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Jc1utFn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Jc1utVn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_JdSaoFn0EeS6Qb3CQxLHEQ" type="compartment_shape_display">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_JdSaoVn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JdSaoln0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <element xmi:type="uml:Component" href="xtextParameterModel.uml#_EN8n8Fn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Jc1usVn0EeS6Qb3CQxLHEQ" x="181" y="96" width="438" height="284"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_ARn8UVn0EeS6Qb3CQxLHEQ" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ARn8Uln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_ARn8U1n0EeS6Qb3CQxLHEQ">
+ <owner xmi:type="uml:Model" href="xtextParameterModel.uml#_AP_koFn0EeS6Qb3CQxLHEQ"/>
+ </styles>
+ <element xmi:type="uml:Model" href="xtextParameterModel.uml#_AP_koFn0EeS6Qb3CQxLHEQ"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_D5aiYFn0EeS6Qb3CQxLHEQ" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_EOGY8Fn0EeS6Qb3CQxLHEQ" type="2002">
+ <children xmi:type="notation:DecorationNode" xmi:id="_EOGY8ln0EeS6Qb3CQxLHEQ" type="5005"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_EOGY81n0EeS6Qb3CQxLHEQ" type="7002">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EOGY9Fn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EOGY9Vn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EOGY9ln0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EOGY91n0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_EOGY-Fn0EeS6Qb3CQxLHEQ" type="7003">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EOGY-Vn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EOGY-ln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EOGY-1n0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EOGY_Fn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_EOGY_Vn0EeS6Qb3CQxLHEQ" type="7004">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EOGY_ln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_EOGY_1n0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_EOGZAFn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EOGZAVn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <element xmi:type="uml:Component" href="xtextParameterModel.uml#_EN8n8Fn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EOGY8Vn0EeS6Qb3CQxLHEQ" x="82" y="94" width="593" height="229"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Expx8Fn0EeS6Qb3CQxLHEQ" type="2010">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Expx8ln0EeS6Qb3CQxLHEQ" type="5035"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Expx81n0EeS6Qb3CQxLHEQ" type="7020">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Expx9Fn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Expx9Vn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Expx9ln0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Expx91n0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_Expx-Fn0EeS6Qb3CQxLHEQ" type="7021">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_Expx-Vn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Expx-ln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Expx-1n0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Expx_Fn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <element xmi:type="uml:DataType" href="xtextParameterModel.uml#_ExgA8Fn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Expx8Vn0EeS6Qb3CQxLHEQ" x="781" y="99"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Fe4EUVn0EeS6Qb3CQxLHEQ" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Fe4EU1n0EeS6Qb3CQxLHEQ" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_FfB1UFn0EeS6Qb3CQxLHEQ" type="7016">
+ <children xmi:type="notation:Shape" xmi:id="_F6__oVn0EeS6Qb3CQxLHEQ" type="3026">
+ <children xmi:type="notation:DecorationNode" xmi:id="_F6__o1n0EeS6Qb3CQxLHEQ" type="5058"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_F6__pFn0EeS6Qb3CQxLHEQ" type="7041">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_F6__pVn0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_F6__pln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_F6__p1n0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F6__qFn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_F6__qVn0EeS6Qb3CQxLHEQ" type="7042">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_F6__qln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_F6__q1n0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_F6__rFn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F6__rVn0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <element xmi:type="uml:PrimitiveType" href="xtextParameterModel.uml#_F6__oFn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F6__oln0EeS6Qb3CQxLHEQ" x="61" y="14"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_FfB1UVn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FfB1Uln0EeS6Qb3CQxLHEQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="xtextParameterModel.uml#_Fe4EUFn0EeS6Qb3CQxLHEQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fe4EUln0EeS6Qb3CQxLHEQ" x="747" y="261" width="314" height="173"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_D5aiYVn0EeS6Qb3CQxLHEQ" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_D5aiYln0EeS6Qb3CQxLHEQ"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_D5aiY1n0EeS6Qb3CQxLHEQ">
+ <owner xmi:type="uml:Model" href="xtextParameterModel.uml#_AP_koFn0EeS6Qb3CQxLHEQ"/>
+ </styles>
+ <element xmi:type="uml:Model" href="xtextParameterModel.uml#_AP_koFn0EeS6Qb3CQxLHEQ"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.uml b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.uml new file mode 100644 index 00000000000..b7d6eb917a9 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/model/xtextParameterModel.uml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_AP_koFn0EeS6Qb3CQxLHEQ" name="model">
+ <packagedElement xmi:type="uml:Component" xmi:id="_EN8n8Fn0EeS6Qb3CQxLHEQ" name="Component1"/>
+ <packagedElement xmi:type="uml:DataType" xmi:id="_ExgA8Fn0EeS6Qb3CQxLHEQ" name="type1"/>
+ <packagedElement xmi:type="uml:Package" xmi:id="_Fe4EUFn0EeS6Qb3CQxLHEQ" name="Package1">
+ <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_F6__oFn0EeS6Qb3CQxLHEQ" name="type2"/>
+ </packagedElement>
+</uml:Model>
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 new file mode 100644 index 00000000000..0e6e81510e9 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/pom.xml @@ -0,0 +1,15 @@ +<?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</groupId> + <artifactId>org.eclipse.papyrus</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../../../../../releng/top-pom-main-tests.xml</relativePath> + </parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.uml.textedit.parameter.tests</artifactId> + <version>1.1.0-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/Activator.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/Activator.java new file mode 100644 index 00000000000..3c28fa87ffb --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/Activator.java @@ -0,0 +1,41 @@ +/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.parameter.tests;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/AllTests.java b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/AllTests.java new file mode 100644 index 00000000000..2ab2c2326c1 --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/AllTests.java @@ -0,0 +1,24 @@ +/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.textedit.parameter.tests.suites;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({
+ ParameterGrammarTests.class
+})
+public class AllTests {
+
+}
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 new file mode 100644 index 00000000000..6a3e2dbf0ea --- /dev/null +++ b/tests/junit/plugins/uml/textedit/org.eclipse.papyrus.uml.textedit.parameter.tests/src/org/eclipse/papyrus/uml/textedit/parameter/tests/suites/ParameterGrammarTests.java @@ -0,0 +1,126 @@ +/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+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.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;
+import org.eclipse.uml2.uml.LiteralReal;
+import org.eclipse.uml2.uml.LiteralString;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.ParameterEffectKind;
+import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.VisibilityKind;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@PluginResource("/model/xtextParameterModel.uml")
+public class ParameterGrammarTests extends AbstractGrammarTest<Parameter> {
+
+ protected PrimitiveType type2; /* QName = model::Package1::type2 */
+
+ protected DataType type1; /* QName = model::type1 */
+
+ protected Model rootModel;
+
+ protected Parameter testedParameter;
+
+ @Before
+ public void loadTestModel() {
+ type2 = findElement(PrimitiveType.class, "type2");
+ type1 = findElement(DataType.class, "type1");
+ rootModel = findElement(Model.class, "model");
+
+ Component component = (Component) rootModel.createPackagedElement("Component1", UMLPackage.eINSTANCE.getComponent());
+ Operation operation = component.createOwnedOperation("op1", new BasicEList<String>(), new BasicEList<Type>());
+ testedParameter = operation.createOwnedParameter("p1", null);
+ }
+
+ @Test
+ public void testParser() throws Exception {
+ tester.parseText(testedParameter, "~in p1: <Undefined>");
+ Assert.assertEquals(ParameterDirectionKind.IN_LITERAL, testedParameter.getDirection());
+ Assert.assertEquals(VisibilityKind.PACKAGE_LITERAL, testedParameter.getVisibility());
+
+ tester.parseText(testedParameter, "p2");
+ Assert.assertEquals(ParameterDirectionKind.IN_LITERAL, testedParameter.getDirection()); // Direction is optional; should not change
+ Assert.assertEquals(VisibilityKind.PACKAGE_LITERAL, testedParameter.getVisibility()); // Visibility is optional; should not change
+ Assert.assertEquals("p2", testedParameter.getName());
+
+ tester.parseText(testedParameter, "p2: model::type1");
+ Assert.assertTrue(testedParameter.getType() == type1);
+
+ tester.parseText(testedParameter, "p2 {exception, ordered, stream, unique}");
+ Assert.assertTrue(testedParameter.isException());
+ Assert.assertTrue(testedParameter.isOrdered());
+ Assert.assertTrue(testedParameter.isStream());
+ Assert.assertTrue(testedParameter.isUnique());
+
+ tester.parseText(testedParameter, "p2 {}");
+ Assert.assertFalse(testedParameter.isException());
+ Assert.assertFalse(testedParameter.isOrdered());
+ Assert.assertFalse(testedParameter.isStream());
+ Assert.assertFalse(testedParameter.isUnique());
+
+ tester.parseText(testedParameter, "p2 = \"Hello\"");
+ Assert.assertNotNull(testedParameter.getDefaultValue());
+ Assert.assertTrue(testedParameter.getDefaultValue() instanceof LiteralString);
+ Assert.assertEquals("Hello", ((LiteralString) testedParameter.getDefaultValue()).getValue());
+ }
+
+ @Test
+ public void testInitialText() {
+ Assert.assertEquals("+ in p1 : <Undefined> {unique}{effect: create}", tester.getInitialText(testedParameter));
+
+ testedParameter.setIsUnique(false);
+ Assert.assertEquals("+ in p1 : <Undefined> {effect: create}", tester.getInitialText(testedParameter));
+
+ testedParameter.setIsStream(true);
+ testedParameter.setIsOrdered(true);
+ testedParameter.setVisibility(VisibilityKind.PROTECTED_LITERAL);
+ testedParameter.setType(type1);
+ testedParameter.setEffect(ParameterEffectKind.DELETE_LITERAL);
+ testedParameter.setDirection(ParameterDirectionKind.RETURN_LITERAL);
+ Assert.assertEquals("# return p1 : model::type1 {ordered, stream}{effect: delete}", tester.getInitialText(testedParameter));
+ }
+
+ @Test
+ public void testDefaultValues() throws Exception {
+ testedParameter.setIsUnique(false);
+
+ LiteralReal defaultRealValue = UMLFactory.eINSTANCE.createLiteralReal();
+ defaultRealValue.setValue(123.54);
+ testedParameter.setDefaultValue(defaultRealValue);
+
+ Assert.assertEquals("+ in p1 : <Undefined> {effect: create} = 123.54", tester.getInitialText(testedParameter));
+ tester.parseText(testedParameter, "p1 = .2");
+ Assert.assertEquals("The instance of ValueSpecification should not change when compatible types are used", defaultRealValue, testedParameter.getDefaultValue());
+ Assert.assertEquals(.2, defaultRealValue.getValue(), 0.001);
+ }
+
+ @Override
+ public DefaultXtextDirectEditorConfiguration getEditor() {
+ return new ParameterXtextDirectEditorConfiguration();
+ }
+}
|