Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java52
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/build.properties4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.di26
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.notation167
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.uml29
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/AllTests.java2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/legacy/PackageDiagramLegacyTest.java106
8 files changed, 362 insertions, 28 deletions
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java
index acacb3f0d33..c19bb4e5147 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/AbstractHouseKeeperRule.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014 CEA and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -113,7 +113,7 @@ public abstract class AbstractHouseKeeperRule {
/**
* Obtains the test name (may as well provide it, since we are a test rule).
- *
+ *
* @return the current test name
*/
public final String getTestName() {
@@ -122,14 +122,14 @@ public abstract class AbstractHouseKeeperRule {
/**
* Adds an {@code object} to clean up later, with a {@code disposer} method that is invoked reflectively to do the cleaning up.
- *
+ *
* @param object
* an object to dispose after the test has completed
* @param disposer
* the disposal method name
* @param arg
* arguments (if any) to the {@code disposer} method
- *
+ *
* @return the {@code object}, for convenience
*/
public <T> T cleanUpLater(T object, String disposer, Object... arg) {
@@ -139,12 +139,12 @@ public abstract class AbstractHouseKeeperRule {
/**
* Adds an {@code object} to clean up later, with a {@code disposer} that does the cleaning up.
- *
+ *
* @param object
* an object to dispose after the test has completed
* @param disposer
* the disposal behaviour
- *
+ *
* @return the {@code object}, for convenience
*/
public <T> T cleanUpLater(T object, Disposer<? super T> disposer) {
@@ -160,10 +160,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Adds an {@code object} to clean up later, using the appropriate built-in disposer.
* Fails if the {@code object} does not have a corresponding built-in disposer.
- *
+ *
* @param object
* an object to dispose after the test has completed
- *
+ *
* @return the {@code object}, for convenience
*/
public <T> T cleanUpLater(T object) {
@@ -175,7 +175,7 @@ public abstract class AbstractHouseKeeperRule {
/**
* Obtains a new resource set that will be disposed of automatically after the test completes.
- *
+ *
* @return the new resource set
*/
public ResourceSet createResourceSet() {
@@ -184,7 +184,7 @@ public abstract class AbstractHouseKeeperRule {
/**
* Creates a new editing domain that will be disposed of automatically after the test completes.
- *
+ *
* @return the editing domain
*/
public TransactionalEditingDomain createSimpleEditingDomain() {
@@ -193,10 +193,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Creates a new editing domain that will be disposed of automatically after the test completes.
- *
+ *
* @param resourceSet
* the resource set on which to create the editing domain (or {@code null} to create a default one)
- *
+ *
* @return the editing domain
*/
public TransactionalEditingDomain createSimpleEditingDomain(ResourceSet resourceSet) {
@@ -209,10 +209,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Creates a project that will be disposed of automatically after the test completes.
- *
+ *
* @param name
* the name of the project
- *
+ *
* @return the project
*/
public IProject createProject(String name) {
@@ -227,21 +227,21 @@ public abstract class AbstractHouseKeeperRule {
/**
* Creates a file in the specified {@code project} with the given {@code fileName}, initialized by copying a
* template resource from the test class's originating bundle.
- *
+ *
* @param project
* the test project in which to create the file
* @param fileName
* the name of the file to create
* @param templatePath
* the path in the test bundle of the template file to copy
- *
+ *
* @return the new file
*/
public IFile createFile(IProject project, String fileName, String templatePath) {
Class<?> testClass = (test instanceof Class<?>) ? (Class<?>)test : test.getClass();
try {
- return cleanUpLater(PapyrusProjectUtils.copyIFile("/resource/TestPureUMLModel.uml", FrameworkUtil.getBundle(testClass), project, fileName), //
+ return cleanUpLater(PapyrusProjectUtils.copyIFile(templatePath, FrameworkUtil.getBundle(testClass), project, fileName), //
WorkspaceResourceDisposer.INSTANCE);
} catch (Exception e) {
fail(e.getMessage());
@@ -251,10 +251,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Opens the default editor on the given {@code file} and ensures that it will be closed after the test terminates.
- *
+ *
* @param file
* the file to open in its editor
- *
+ *
* @return the editor
*/
public IEditorPart openEditor(final IFile file) {
@@ -276,10 +276,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Opens the Papyrus editor on the given {@code file} and ensures that it will be closed after the test terminates.
- *
+ *
* @param file
* the file to open in the Papyrus editor
- *
+ *
* @return the editor
*/
public IMultiDiagramEditor openPapyrusEditor(final IFile file) {
@@ -301,10 +301,10 @@ public abstract class AbstractHouseKeeperRule {
/**
* Obtains the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes.
- *
+ *
* @param fieldName
* the field to access now and clear later
- *
+ *
* @return the value of the field
*/
public <T> T getField(String fieldName) {
@@ -346,12 +346,12 @@ public abstract class AbstractHouseKeeperRule {
/**
* Sets the value of the named field of the test instance and ensures that it will be automatically cleared after the test completes.
- *
+ *
* @param fieldName
* the field to access now and clear later
* @param value
* the value to set
- *
+ *
* @return the new value of the field
*/
public <T> T setField(String fieldName, T value) {
@@ -490,7 +490,7 @@ public abstract class AbstractHouseKeeperRule {
}
public void dispose(ResourceSet object) {
- if (object instanceof ModelSet) {
+ if(object instanceof ModelSet) {
((ModelSet)object).unload();
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/META-INF/MANIFEST.MF
index bf2f0688eb7..7337f897aa0 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/META-INF/MANIFEST.MF
@@ -14,7 +14,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.junit;bundle-version="4.10.0",
org.eclipse.papyrus.junit.utils;bundle-version="1.0.0",
- org.eclipse.gmf.tooling.runtime
+ org.eclipse.gmf.tooling.runtime,
+ org.eclipse.ui.ide;bundle-version="3.10.0",
+ org.eclipse.emf.common.ui;bundle-version="2.9.0"
Export-Package: org.eclipse.papyrus.diagram.clazz.test,
org.eclipse.papyrus.diagram.clazz.test.canonical,
org.eclipse.papyrus.diagram.clazz.test.createFromPalette,
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/build.properties b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/build.properties
index be5eee65498..7e498d132d6 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/build.properties
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/build.properties
@@ -1,7 +1,9 @@
-source.. = test/
+source.. = test/,\
+ test-gen/
output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
org.eclipse.papyrus.diagram.clazz.test.launch,\
plugin.properties
+src.includes = about.html
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.di
new file mode 100644
index 00000000000..fa44dbfd5bc
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.di
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="package24.notation#_y2V9wBM4EeSW8ufHPtpJcQ"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="package24.notation#_Da1q0BM5EeSW8ufHPtpJcQ"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="package24.notation#_L0CKYBM5EeSW8ufHPtpJcQ"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="package24.notation#_L0CKYBM5EeSW8ufHPtpJcQ"/>
+ </children>
+ <children>
+ <emfPageIdentifier href="package24.notation#_y2V9wBM4EeSW8ufHPtpJcQ"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.notation
new file mode 100644
index 00000000000..797265662d8
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.notation
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML">
+ <notation:Diagram xmi:id="_y2V9wBM4EeSW8ufHPtpJcQ" type="Package" name="Diagram1" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_1KkqMBM4EeSW8ufHPtpJcQ" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_1K72kBM4EeSW8ufHPtpJcQ" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_1K9EsBM4EeSW8ufHPtpJcQ" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_1K9EsRM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1K9EshM4EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_1JXwUBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1KkqMRM4EeSW8ufHPtpJcQ" x="416" y="196"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_1YKaQBM4EeSW8ufHPtpJcQ" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_1YKaQhM4EeSW8ufHPtpJcQ" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_1YLBUBM4EeSW8ufHPtpJcQ" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_1YLBURM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1YLBUhM4EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_1YJMIBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1YKaQRM4EeSW8ufHPtpJcQ" x="876" y="197"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_2StW8BM4EeSW8ufHPtpJcQ" type="2005">
+ <children xmi:type="notation:DecorationNode" xmi:id="_2StW8hM4EeSW8ufHPtpJcQ" type="5020"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_2StW8xM4EeSW8ufHPtpJcQ" type="7009">
+ <children xmi:type="notation:Shape" xmi:id="_2v3NABM4EeSW8ufHPtpJcQ" type="3009">
+ <children xmi:type="notation:DecorationNode" xmi:id="_2v3NAhM4EeSW8ufHPtpJcQ" type="5017"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_2v3NAxM4EeSW8ufHPtpJcQ" type="7010">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_2v3NBBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2v3NBRM4EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_2v0wwBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2v3NARM4EeSW8ufHPtpJcQ" x="56" y="51"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_24pVkBM4EeSW8ufHPtpJcQ" type="3009">
+ <children xmi:type="notation:DecorationNode" xmi:id="_24pVkhM4EeSW8ufHPtpJcQ" type="5017"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_24pVkxM4EeSW8ufHPtpJcQ" type="7010">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_24pVlBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_24pVlRM4EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_24m5UBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_24pVkRM4EeSW8ufHPtpJcQ" x="359" y="50"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_2StW9BM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2StW9RM4EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Model" href="package24.uml#_2Sq6sBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2StW8RM4EeSW8ufHPtpJcQ" x="1172" y="114" width="652" height="249"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_4U-JoBM4EeSW8ufHPtpJcQ" type="2012">
+ <children xmi:type="notation:DecorationNode" xmi:id="_4U-wsRM4EeSW8ufHPtpJcQ" type="5038"/>
+ <element xmi:type="uml:Comment" href="package24.uml#_4UdzUBM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4U-wsBM4EeSW8ufHPtpJcQ" x="1473" y="482"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_7icyQBM4EeSW8ufHPtpJcQ" type="2011">
+ <children xmi:type="notation:DecorationNode" xmi:id="_7icyQhM4EeSW8ufHPtpJcQ" type="5037"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_7icyQxM4EeSW8ufHPtpJcQ" type="5159"/>
+ <element xmi:type="uml:Constraint" href="package24.uml#_7iZH4BM4EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_7icyQRM4EeSW8ufHPtpJcQ" x="1050" y="489"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_y2V9wRM4EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Model" href="package24.uml#_yzyZABM4EeSW8ufHPtpJcQ"/>
+ <edges xmi:type="notation:Connector" xmi:id="_1u44MBM4EeSW8ufHPtpJcQ" type="4008" source="_1KkqMBM4EeSW8ufHPtpJcQ" target="_1YKaQBM4EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_1u5fQBM4EeSW8ufHPtpJcQ" type="6026">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_1u5fQRM4EeSW8ufHPtpJcQ" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_1u5fQhM4EeSW8ufHPtpJcQ" type="6027">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_1u5fQxM4EeSW8ufHPtpJcQ" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_1u44MRM4EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Dependency" href="package24.uml#_1tPSYBM4EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_1u44MhM4EeSW8ufHPtpJcQ" points="[100, 8, -360, 7]$[560, 8, 100, 7]"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_3nLPgBM4EeSW8ufHPtpJcQ" type="4008" source="_2v3NABM4EeSW8ufHPtpJcQ" target="_1YKaQBM4EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_3nLPgxM4EeSW8ufHPtpJcQ" type="6026">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_3nL2kBM4EeSW8ufHPtpJcQ" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_3nL2kRM4EeSW8ufHPtpJcQ" type="6027">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_3nL2khM4EeSW8ufHPtpJcQ" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_3nLPgRM4EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Dependency" href="package24.uml#_3nIzQBM4EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_3nLPghM4EeSW8ufHPtpJcQ" points="[-100, 4, 254, -19]$[-361, -5, -7, -28]"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_45HYgBM4EeSW8ufHPtpJcQ" type="4013" source="_4U-JoBM4EeSW8ufHPtpJcQ" target="_24pVkBM4EeSW8ufHPtpJcQ">
+ <styles xmi:type="notation:FontStyle" xmi:id="_45HYgRM4EeSW8ufHPtpJcQ"/>
+ <element xsi:nil="true"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_45HYghM4EeSW8ufHPtpJcQ" points="[3, -50, -19, 230]$[20, -308, -2, -28]"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_5NSRsBM4EeSW8ufHPtpJcQ" type="4010" source="_2v3NABM4EeSW8ufHPtpJcQ" target="_1KkqMBM4EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_5NS4wBM4EeSW8ufHPtpJcQ" type="6022">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5NS4wRM4EeSW8ufHPtpJcQ" y="40"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_5NSRsRM4EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:PackageImport" href="package24.uml#_5NPOYBM4EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_5NSRshM4EeSW8ufHPtpJcQ" points="[8, 50, 825, 47]$[8, 188, 825, 185]$[-811, 188, 6, 185]$[-811, 53, 6, 50]"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_AAMI4BM5EeSW8ufHPtpJcQ" type="4006" source="_24pVkBM4EeSW8ufHPtpJcQ" target="_2v3NABM4EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_AAMI4xM5EeSW8ufHPtpJcQ" type="6014">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_AAMv8BM5EeSW8ufHPtpJcQ" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_AAMv8RM5EeSW8ufHPtpJcQ" type="6015">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_AAMv8hM5EeSW8ufHPtpJcQ" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_AAMI4RM5EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Abstraction" href="package24.uml#_AAJFkBM5EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_AAMI4hM5EeSW8ufHPtpJcQ" points="[-100, 0, 129, 4]$[-329, 0, -100, 4]"/>
+ </edges>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_Da1q0BM5EeSW8ufHPtpJcQ" type="Package" name="ClosedDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_D1e_cBM5EeSW8ufHPtpJcQ" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_D1e_chM5EeSW8ufHPtpJcQ" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_D1e_cxM5EeSW8ufHPtpJcQ" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_D1e_dBM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D1e_dRM5EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_D1dKQBM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D1e_cRM5EeSW8ufHPtpJcQ" x="614" y="254"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_EZN-oBM5EeSW8ufHPtpJcQ" type="2005">
+ <children xmi:type="notation:DecorationNode" xmi:id="_EZN-ohM5EeSW8ufHPtpJcQ" type="5020"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_EZN-oxM5EeSW8ufHPtpJcQ" type="7009">
+ <children xmi:type="notation:Shape" xmi:id="_D6T1EBM5EeSW8ufHPtpJcQ" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_D6UcIBM5EeSW8ufHPtpJcQ" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_D6UcIRM5EeSW8ufHPtpJcQ" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_D6UcIhM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D6UcIxM5EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Package" href="package24.uml#_D6Sm8BM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D6T1ERM5EeSW8ufHPtpJcQ" x="15" y="47"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_EZN-pBM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EZN-pRM5EeSW8ufHPtpJcQ"/>
+ </children>
+ <element xmi:type="uml:Model" href="package24.uml#_EZMwgBM5EeSW8ufHPtpJcQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EZN-oRM5EeSW8ufHPtpJcQ" x="909" y="174" width="395" height="226"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_Da1q0RM5EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Model" href="package24.uml#_yzyZABM4EeSW8ufHPtpJcQ"/>
+ <edges xmi:type="notation:Connector" xmi:id="_GAooYBM5EeSW8ufHPtpJcQ" type="4006" source="_D6T1EBM5EeSW8ufHPtpJcQ" target="_D1e_cBM5EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_GAooYxM5EeSW8ufHPtpJcQ" type="6014">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_GAooZBM5EeSW8ufHPtpJcQ" y="21"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_GAooZRM5EeSW8ufHPtpJcQ" type="6015">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_GApPcBM5EeSW8ufHPtpJcQ" x="13" y="36"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_GAooYRM5EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Abstraction" href="package24.uml#_GAmMIBM5EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_GAooYhM5EeSW8ufHPtpJcQ" points="[-100, 6, 214, -8]$[-214, 20, 100, 6]"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_HGT3ABM5EeSW8ufHPtpJcQ" type="4008" source="_EZN-oBM5EeSW8ufHPtpJcQ" target="_D1e_cBM5EeSW8ufHPtpJcQ">
+ <children xmi:type="notation:DecorationNode" xmi:id="_HGUeEBM5EeSW8ufHPtpJcQ" type="6026">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_HGUeERM5EeSW8ufHPtpJcQ" x="-6" y="13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_HGUeEhM5EeSW8ufHPtpJcQ" type="6027">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_HGUeExM5EeSW8ufHPtpJcQ" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_HGT3ARM5EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Dependency" href="package24.uml#_HGQzsBM5EeSW8ufHPtpJcQ"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_HGT3AhM5EeSW8ufHPtpJcQ" points="[0, 13, 428, 96]$[0, 64, 428, 147]$[-434, 64, -6, 147]$[-434, -33, -6, 50]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_HGfdMBM5EeSW8ufHPtpJcQ" id="(0.589873417721519,0.9424778761061947)"/>
+ </edges>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_L0CKYBM5EeSW8ufHPtpJcQ" type="PapyrusTestInvalidDiagram" name="InvalidDiagram" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_L0CxcBM5EeSW8ufHPtpJcQ"/>
+ <element xmi:type="uml:Package" href="package24.uml#_1JXwUBM4EeSW8ufHPtpJcQ"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.uml
new file mode 100644
index 00000000000..b58df229832
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/model/legacyPackage/package24.uml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_yzyZABM4EeSW8ufHPtpJcQ" name="model">
+ <ownedComment xmi:type="uml:Comment" xmi:id="_4UdzUBM4EeSW8ufHPtpJcQ" annotatedElement="_24m5UBM4EeSW8ufHPtpJcQ">
+ <body> </body>
+ </ownedComment>
+ <packagedElement xmi:type="uml:Package" xmi:id="_1JXwUBM4EeSW8ufHPtpJcQ" clientDependency="_1tPSYBM4EeSW8ufHPtpJcQ" name="Package1">
+ <packagedElement xmi:type="uml:Dependency" xmi:id="_1tPSYBM4EeSW8ufHPtpJcQ" name="Dependency1" client="_1JXwUBM4EeSW8ufHPtpJcQ" supplier="_1YJMIBM4EeSW8ufHPtpJcQ"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_1YJMIBM4EeSW8ufHPtpJcQ" name="Package2"/>
+ <packagedElement xmi:type="uml:Model" xmi:id="_2Sq6sBM4EeSW8ufHPtpJcQ" name="Model1">
+ <packagedElement xmi:type="uml:Package" xmi:id="_2v0wwBM4EeSW8ufHPtpJcQ" clientDependency="_3nIzQBM4EeSW8ufHPtpJcQ" name="Package1">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_5NPOYBM4EeSW8ufHPtpJcQ" importedPackage="_1JXwUBM4EeSW8ufHPtpJcQ"/>
+ <packagedElement xmi:type="uml:Dependency" xmi:id="_3nIzQBM4EeSW8ufHPtpJcQ" name="Dependency1" client="_2v0wwBM4EeSW8ufHPtpJcQ" supplier="_1YJMIBM4EeSW8ufHPtpJcQ"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_24m5UBM4EeSW8ufHPtpJcQ" clientDependency="_AAJFkBM5EeSW8ufHPtpJcQ" name="Package2">
+ <packagedElement xmi:type="uml:Abstraction" xmi:id="_AAJFkBM5EeSW8ufHPtpJcQ" name="Abstraction1" client="_24m5UBM4EeSW8ufHPtpJcQ" supplier="_2v0wwBM4EeSW8ufHPtpJcQ"/>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Constraint" xmi:id="_7iZH4BM4EeSW8ufHPtpJcQ" name="Constraint1">
+ <specification xmi:type="uml:LiteralString" xmi:id="_7iaWABM4EeSW8ufHPtpJcQ" value=""/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_D1dKQBM5EeSW8ufHPtpJcQ" name="Package3"/>
+ <packagedElement xmi:type="uml:Model" xmi:id="_EZMwgBM5EeSW8ufHPtpJcQ" clientDependency="_HGQzsBM5EeSW8ufHPtpJcQ" name="Model2">
+ <packagedElement xmi:type="uml:Package" xmi:id="_D6Sm8BM5EeSW8ufHPtpJcQ" clientDependency="_GAmMIBM5EeSW8ufHPtpJcQ" name="Package4">
+ <packagedElement xmi:type="uml:Abstraction" xmi:id="_GAmMIBM5EeSW8ufHPtpJcQ" name="Abstraction1" client="_D6Sm8BM5EeSW8ufHPtpJcQ" supplier="_D1dKQBM5EeSW8ufHPtpJcQ"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Dependency" xmi:id="_HGQzsBM5EeSW8ufHPtpJcQ" name="Dependency1" client="_EZMwgBM5EeSW8ufHPtpJcQ" supplier="_D1dKQBM5EeSW8ufHPtpJcQ"/>
+ </packagedElement>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/AllTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/AllTests.java
index e03590f2753..0a58abec8f6 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/AllTests.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/AllTests.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.diagram.clazz.test;
import org.eclipse.papyrus.diagram.clazz.test.canonical.AllCanonicalTests;
+import org.eclipse.papyrus.diagram.clazz.test.legacy.PackageDiagramLegacyTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@@ -25,6 +26,7 @@ import org.junit.runners.Suite.SuiteClasses;
@SuiteClasses({
// canonical
AllCanonicalTests.class,
+PackageDiagramLegacyTest.class
// load
//LoadTests.class
})
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/legacy/PackageDiagramLegacyTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/legacy/PackageDiagramLegacyTest.java
new file mode 100644
index 00000000000..8f390ae2119
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.diagram.clazz.tests/test/org/eclipse/papyrus/diagram/clazz/test/legacy/PackageDiagramLegacyTest.java
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * 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.diagram.clazz.test.legacy;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.junit.utils.rules.HouseKeeper;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * Test class for opening Papyrus 0.10.x Package Diagrams in Papyrus >= 1.0.x
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class PackageDiagramLegacyTest extends AbstractPapyrusTest {
+
+ @Rule
+ public final HouseKeeper houseKeeper = new HouseKeeper();
+
+ protected IMultiDiagramEditor editor;
+
+ protected IPageManager pageManager;
+
+ @Before
+ public void initModel() throws Exception {
+ IProject project = houseKeeper.createProject("uml2.4diagrams");
+ IFile diFile = houseKeeper.createFile(project, "package24.di", "model/legacyPackage/package24.di");
+ houseKeeper.createFile(project, "package24.uml", "model/legacyPackage/package24.uml");
+ houseKeeper.createFile(project, "package24.notation", "model/legacyPackage/package24.notation");
+
+ editor = houseKeeper.openPapyrusEditor(diFile);
+ pageManager = ServiceUtils.getInstance().getIPageManager(editor.getServicesRegistry());
+ }
+
+ @Test
+ public void testOpening24PackageModel() throws Exception {
+ Assert.assertEquals(3, pageManager.allPages().size());
+
+ Diagram diagram1 = getDiagram("Diagram1");
+ Assert.assertEquals("PapyrusUMLClassDiagram", diagram1.getType());
+ pageManager.selectPage(diagram1);
+
+ IEditorPart diagram1Editor = editor.getActiveEditor();
+ Assert.assertTrue(diagram1Editor instanceof UmlClassDiagramForMultiEditor);
+ }
+
+ protected Diagram getDiagram(String name) {
+ for(Object page : pageManager.allPages()) {
+ if(page instanceof Diagram) {
+ if(name.equals(((Diagram)page).getName())) {
+ return (Diagram)page;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Test
+ public void testOpening24PackageDiagram() throws Exception {
+ Assert.assertEquals(3, pageManager.allPages().size());
+
+ Diagram closedDiagram = getDiagram("ClosedDiagram");
+ Diagram invalidDiagram = getDiagram("InvalidDiagram");
+
+ pageManager.closePage(invalidDiagram);
+
+ pageManager.openPage(closedDiagram);
+
+ //Assert.assertEquals("PapyrusUMLClassDiagram", closedDiagram.getType());
+
+ pageManager.selectPage(closedDiagram); //Workaround for an unrelated bug: the page is not immediately selected after it has been opened
+
+ IEditorPart closedDiagramEditor = editor.getActiveEditor();
+
+ Assert.assertEquals(closedDiagramEditor.getClass(), UmlClassDiagramForMultiEditor.class);
+
+ IEditorInput input = closedDiagramEditor.getEditorInput();
+ Assert.assertTrue(input instanceof URIEditorInput);
+ URIEditorInput uriInput = (URIEditorInput)input;
+
+ Assert.assertTrue(uriInput.getURI().equals(EcoreUtil.getURI(closedDiagram)));
+ }
+}

Back to the top