Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2019-08-29 13:46:35 +0000
committerPatrick Tessier2019-09-17 12:43:16 +0000
commit20f8e49b96250d184559516741f332413d3f3f33 (patch)
tree2832caf86091985f16d78e010e54931d068bf65d /tests/junit/plugins
parent9b317308ac234971b0fb5920e2c2086eb87b6ea4 (diff)
downloadorg.eclipse.papyrus-20f8e49b96250d184559516741f332413d3f3f33.tar.gz
org.eclipse.papyrus-20f8e49b96250d184559516741f332413d3f3f33.tar.xz
org.eclipse.papyrus-20f8e49b96250d184559516741f332413d3f3f33.zip
Bug 550567: [AF] Diagrams and tables should be visible even if its
viewpoint is not enable Remove the filter corresponding of viewpoint check. Change-Id: Id6dedc263075fc113747d9938ec75f1cfdb2789e Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'tests/junit/plugins')
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/META-INF/MANIFEST.MF5
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.di2
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.notation86
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.uml10
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/AllTests.java2
-rw-r--r--tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/editors/ModelExplorerViewpointFilterTest.java86
6 files changed, 190 insertions, 1 deletions
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/META-INF/MANIFEST.MF
index 86d75e629de..181655a4fe7 100644
--- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/META-INF/MANIFEST.MF
@@ -12,6 +12,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit;bundle-version="4.12.0",
org.eclipse.papyrus.junit.utils;bundle-version="2.2.0",
org.eclipse.papyrus.infra.architecture;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.ui.architecture;bundle-version="[2.1.0,3.0.0)"
+ org.eclipse.papyrus.infra.ui.architecture;bundle-version="[2.1.0,3.0.0)",
+ org.eclipse.papyrus.infra.emf;bundle-version="[3.1.0,4.0.0)",
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="[3.1.0,4.0.0)",
+ org.eclipse.papyrus.views.modelexplorer.tests;bundle-version="[1.2.0,2.0.0)"
Export-Package: org.eclipse.papyrus.infra.ui.architecture.tests
Bundle-Activator: org.eclipse.papyrus.infra.ui.architecture.tests.Activator
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.di b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.di
new file mode 100644
index 00000000000..8c549eecdc6
--- /dev/null
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<architecture:ArchitectureDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" contextId="org.eclipse.papyrus.infra.services.edit.TypeContext"/>
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.notation b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.notation
new file mode 100644
index 00000000000..4e74b830dfc
--- /dev/null
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.notation
@@ -0,0 +1,86 @@
+<?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:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xsi:schemaLocation="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis http://www.eclipse.org/papyrus/nattable/model#//nattableaxis http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model#//nattableaxisprovider">
+ <nattable:Table xmi:id="_1pHmAM5CEemJH8FcCaThIQ" name="Class Tree Table" currentRowAxisProvider="_1pHmA85CEemJH8FcCaThIQ" currentColumnAxisProvider="_1pHmAc5CEemJH8FcCaThIQ" tableKindId="org.eclipse.papyrus.uml.table.classTree">
+ <eAnnotations xmi:id="_1pINEM5CEemJH8FcCaThIQ" source="http://www.eclipse.org/papyrus/infra/nattable/version">
+ <details xmi:id="_1pINEc5CEemJH8FcCaThIQ" key="version" value="1.3.0"/>
+ </eAnnotations>
+ <context href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ <owner href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ <tableConfiguration href="platform:/resource/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration#PapyrusClassTreeTable_XMI_ID"/>
+ <columnAxisProvidersHistory xsi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_1pHmAc5CEemJH8FcCaThIQ" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider">
+ <axis xsi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_1pHmAs5CEemJH8FcCaThIQ">
+ <manager href="platform:/resource/org.eclipse.papyrus.uml.nattable.clazz.config/configs/class_synchronized_tree.nattableconfiguration#_UJa7yDzQEei_1txcmoHe_A"/>
+ <element xsi:type="ecore:EAttribute" href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement/name"/>
+ </axis>
+ </columnAxisProvidersHistory>
+ <rowAxisProvidersHistory xsi:type="nattableaxisprovider:MasterObjectAxisProvider" xmi:id="_1pHmA85CEemJH8FcCaThIQ" description="This axis provider manages the rows, according to the wanted hierarchy" name="HierarchicalRowaAxisManager" disconnectSlave="true"/>
+ </nattable:Table>
+ <notation:Diagram xmi:id="_1pJbMM5CEemJH8FcCaThIQ" type="PapyrusUMLClassDiagram" name="Class Diagram" measurementUnit="Pixel">
+ <styles xsi:type="notation:StringValueStyle" xmi:id="_1pJbMc5CEemJH8FcCaThIQ" name="diagram_compatibility_version" stringValue="1.4.0"/>
+ <styles xsi:type="notation:DiagramStyle" xmi:id="_1pJbMs5CEemJH8FcCaThIQ"/>
+ <styles xsi:type="style:PapyrusDiagramStyle" xmi:id="_1pJbM85CEemJH8FcCaThIQ" diagramKindId="org.eclipse.papyrus.uml.diagram.class">
+ <owner href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ </styles>
+ <element href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_1pOTsM5CEemJH8FcCaThIQ" type="PapyrusUMLStateMachineDiagram" name="State Machine Diagram" measurementUnit="Pixel">
+ <children xsi:type="notation:Shape" xmi:id="_1pOTsc5CEemJH8FcCaThIQ" type="StateMachine_Shape">
+ <children xsi:type="notation:DecorationNode" xmi:id="_1pOTss5CEemJH8FcCaThIQ" type="StateMachine_NameLabel">
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pOTs85CEemJH8FcCaThIQ" width="700" height="20"/>
+ </children>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pOTtM5CEemJH8FcCaThIQ" type="StateMachine_RegionCompartment">
+ <children xsi:type="notation:Shape" xmi:id="_1pOTtc5CEemJH8FcCaThIQ" type="Region_Shape">
+ <eAnnotations xmi:id="_1pOTts5CEemJH8FcCaThIQ" source="RegionAnnotationKey">
+ <details xmi:id="_1pOTt85CEemJH8FcCaThIQ" key="RegionZoneKey" value=""/>
+ </eAnnotations>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pOTuM5CEemJH8FcCaThIQ" type="Region_SubvertexCompartment">
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pOTuc5CEemJH8FcCaThIQ"/>
+ </children>
+ <element href="ModelExplorerViewpointFilter.uml#_1pNsoM5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pOTus5CEemJH8FcCaThIQ" width="700" height="280"/>
+ </children>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pOTu85CEemJH8FcCaThIQ" y="20" width="700" height="280"/>
+ </children>
+ <element href="ModelExplorerViewpointFilter.uml#_1pL3cM5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pOTvM5CEemJH8FcCaThIQ" x="30" y="30" width="700" height="300"/>
+ </children>
+ <styles xsi:type="notation:StringValueStyle" xmi:id="_1pOTvc5CEemJH8FcCaThIQ" name="diagram_compatibility_version" stringValue="1.4.0"/>
+ <styles xsi:type="notation:DiagramStyle" xmi:id="_1pOTvs5CEemJH8FcCaThIQ"/>
+ <styles xsi:type="style:PapyrusDiagramStyle" xmi:id="_1pOTv85CEemJH8FcCaThIQ" diagramKindId="org.eclipse.papyrus.uml.diagram.stateMachine">
+ <owner href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ </styles>
+ <element href="ModelExplorerViewpointFilter.uml#_1pL3cM5CEemJH8FcCaThIQ"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_1pQv8M5CEemJH8FcCaThIQ" type="PapyrusUMLActivityDiagram" name="Activity Diagram" measurementUnit="Pixel">
+ <children xsi:type="notation:Shape" xmi:id="_1pQv8c5CEemJH8FcCaThIQ" type="Activity_Shape">
+ <children xsi:type="notation:DecorationNode" xmi:id="_1pQv8s5CEemJH8FcCaThIQ" type="Activity_NameLabel"/>
+ <children xsi:type="notation:DecorationNode" xmi:id="_1pQv885CEemJH8FcCaThIQ" type="Activity_KeywordLabel"/>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pQv9M5CEemJH8FcCaThIQ" type="Activity_ParameterCompartment">
+ <styles xsi:type="notation:SortingStyle" xmi:id="_1pRXAM5CEemJH8FcCaThIQ"/>
+ <styles xsi:type="notation:FilteringStyle" xmi:id="_1pRXAc5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pRXAs5CEemJH8FcCaThIQ"/>
+ </children>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pRXA85CEemJH8FcCaThIQ" type="Activity_PreconditionCompartment">
+ <styles xsi:type="notation:SortingStyle" xmi:id="_1pRXBM5CEemJH8FcCaThIQ"/>
+ <styles xsi:type="notation:FilteringStyle" xmi:id="_1pRXBc5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pRXBs5CEemJH8FcCaThIQ"/>
+ </children>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pRXB85CEemJH8FcCaThIQ" type="Activity_PostconditionCompartment">
+ <styles xsi:type="notation:SortingStyle" xmi:id="_1pRXCM5CEemJH8FcCaThIQ"/>
+ <styles xsi:type="notation:FilteringStyle" xmi:id="_1pRXCc5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pRXCs5CEemJH8FcCaThIQ"/>
+ </children>
+ <children xsi:type="notation:BasicCompartment" xmi:id="_1pRXC85CEemJH8FcCaThIQ" type="Activity_ActivityNodeCompartment">
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pRXDM5CEemJH8FcCaThIQ"/>
+ </children>
+ <element href="ModelExplorerViewpointFilter.uml#_1pQI4M5CEemJH8FcCaThIQ"/>
+ <layoutConstraint xsi:type="notation:Bounds" xmi:id="_1pRXDc5CEemJH8FcCaThIQ"/>
+ </children>
+ <styles xsi:type="notation:StringValueStyle" xmi:id="_1pRXDs5CEemJH8FcCaThIQ" name="diagram_compatibility_version" stringValue="1.4.0"/>
+ <styles xsi:type="notation:DiagramStyle" xmi:id="_1pRXD85CEemJH8FcCaThIQ"/>
+ <styles xsi:type="style:PapyrusDiagramStyle" xmi:id="_1pRXEM5CEemJH8FcCaThIQ" diagramKindId="org.eclipse.papyrus.uml.diagram.activity">
+ <owner href="ModelExplorerViewpointFilter.uml#_1pCtgM5CEemJH8FcCaThIQ"/>
+ </styles>
+ <element href="ModelExplorerViewpointFilter.uml#_1pQI4M5CEemJH8FcCaThIQ"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.uml b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.uml
new file mode 100644
index 00000000000..cfa728c5f19
--- /dev/null
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/resources/ModelExplorerViewpointFilter.uml
@@ -0,0 +1,10 @@
+<?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="_1pCtgM5CEemJH8FcCaThIQ" name="ModelExplorerViewpointFilter">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_1q5usM5CEemJH8FcCaThIQ">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:StateMachine" xmi:id="_1pL3cM5CEemJH8FcCaThIQ" name="StateMachine1">
+ <region xmi:type="uml:Region" xmi:id="_1pNsoM5CEemJH8FcCaThIQ" name="Region1"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Activity" xmi:id="_1pQI4M5CEemJH8FcCaThIQ" name="Activity2"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/AllTests.java b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/AllTests.java
index 0bccc3d14ba..4562c8ce382 100644
--- a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/AllTests.java
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/AllTests.java
@@ -14,6 +14,7 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.ui.architecture.tests;
+import org.eclipse.papyrus.infra.ui.architecture.tests.editors.ModelExplorerViewpointFilterTest;
import org.eclipse.papyrus.infra.ui.architecture.tests.editors.SwitchViewpointsTest;
import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite;
import org.eclipse.papyrus.junit.framework.runner.Headless;
@@ -26,6 +27,7 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith(ClassificationSuite.class)
@SuiteClasses({
SwitchViewpointsTest.class,
+ ModelExplorerViewpointFilterTest.class,
})
@Headless
public class AllTests {
diff --git a/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/editors/ModelExplorerViewpointFilterTest.java b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/editors/ModelExplorerViewpointFilterTest.java
new file mode 100644
index 00000000000..0e71ded27c5
--- /dev/null
+++ b/tests/junit/plugins/infra/org.eclipse.papyrus.infra.ui.architecture.tests/src/org/eclipse/papyrus/infra/ui/architecture/tests/editors/ModelExplorerViewpointFilterTest.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2019 CEA LIST and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.ui.architecture.tests.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.ui.architecture.tests.Activator;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.views.modelexplorer.tests.AbstractHandlerTest;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * This class allows to test the viewpoint filter in the ModelExplorer.
+ * Currently, all the diagrams and tables should be visible (bug 550567).
+ */
+@SuppressWarnings("nls")
+@PluginResource("/resources/ModelExplorerViewpointFilter.di")
+public class ModelExplorerViewpointFilterTest extends AbstractHandlerTest {
+
+ /**
+ * Constructor.
+ */
+ public ModelExplorerViewpointFilterTest() {
+ super(Activator.getDefault().getBundle());
+ }
+
+ /**
+ * This allows to test the viewpoint filter for diagrams and tables.
+ *
+ * @throws ServiceException
+ * The service Exception.
+ */
+ @Test
+ public void revealDiagramsAndTables() throws ServiceException {
+
+ // Manage the selection
+ final List<Object> selectedElement = new ArrayList<>();
+ final List<Diagram> diagrams = getDiagrams();
+ final List<Table> tables = getTables();
+
+ // select all the diagrams and tables
+ selectedElement.addAll(diagrams);
+ selectedElement.addAll(tables);
+
+ getModelExplorerView().revealSemanticElement(selectedElement);
+ RunnableWithResult<IWorkbenchPart> activePartRunnable;
+ Display.getDefault().syncExec(activePartRunnable = new RunnableWithResult.Impl<IWorkbenchPart>() {
+
+ public void run() {
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPart activePart = activePage.getActivePart();
+ setResult(activePart);
+ }
+ });
+
+ Assert.assertTrue("The active part is not the ModelExplorer", activePartRunnable.getResult() instanceof ModelExplorerPageBookView);
+ final IStructuredSelection currentSelection = getCurrentSelection();
+ // There are 4 diagrams and tables, no one should be hidden
+ Assert.assertEquals("Diagrams and tables shouln't be hidden", 4, currentSelection.size());
+ }
+}

Back to the top