From 9e05c37db19061fa09e38bb82298037c62fe1202 Mon Sep 17 00:00:00 2001
From: Vincent Lorenzo
Date: Mon, 21 Jul 2014 13:35:25 +0200
Subject: Fix build problems due to new tests plugins
---
.../META-INF/MANIFEST.MF | 6 +-
.../org/eclipse/papyrus/tests/extra/AllTests.java | 10 +-
.../META-INF/MANIFEST.MF | 1 +
.../NattableCommonTests.launch | 4 +-
.../papyrus/infra/nattable/tests/AllTests.java | 25 --
.../nattable/tests/TableSelectionProviderTest.java | 276 -----------------
.../infra/nattable/tests/tests/AllTests.java | 25 ++
.../tests/tests/TableSelectionProviderTest.java | 277 +++++++++++++++++
.../META-INF/MANIFEST.MF | 2 +
.../META-INF/MANIFEST.MF | 1 +
.../org.eclipse.papyrus.tests/META-INF/MANIFEST.MF | 3 +-
.../test/org/eclipse/papyrus/tests/AllTests.java | 1 +
.../META-INF/MANIFEST.MF | 1 +
...eclipse.papyrus.uml.diagram.common.tests.launch | 4 +-
.../papyrus/uml/diagram/common/tests/AllTests.java | 25 --
.../diagram/common/tests/CommonBendpointsTest.java | 332 --------------------
.../uml/diagram/common/tests/tests/AllTests.java | 25 ++
.../common/tests/tests/CommonBendpointsTest.java | 333 +++++++++++++++++++++
18 files changed, 684 insertions(+), 667 deletions(-)
delete mode 100644 tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/AllTests.java
delete mode 100644 tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/TableSelectionProviderTest.java
create mode 100644 tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/tests/AllTests.java
create mode 100644 tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/tests/TableSelectionProviderTest.java
delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/src/org/eclipse/papyrus/uml/diagram/common/tests/AllTests.java
delete mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/src/org/eclipse/papyrus/uml/diagram/common/tests/CommonBendpointsTest.java
create mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/src/org/eclipse/papyrus/uml/diagram/common/tests/tests/AllTests.java
create mode 100644 tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common.tests/src/org/eclipse/papyrus/uml/diagram/common/tests/tests/CommonBendpointsTest.java
diff --git a/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/META-INF/MANIFEST.MF b/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/META-INF/MANIFEST.MF
index 1b92adee520..170f99d69e2 100644
--- a/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/META-INF/MANIFEST.MF
+++ b/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/META-INF/MANIFEST.MF
@@ -12,7 +12,11 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.nattable.tests;bundle-version="0.10.2",
org.eclipse.papyrus.sysml.nattable.requirement.tests;bundle-version="0.10.2",
org.eclipse.papyrus.infra.nattable.views.editor.tests;bundle-version="0.10.2",
- org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="0.10.2"
+ org.eclipse.papyrus.infra.nattable.model.editor.tests;bundle-version="0.10.2",
+ org.eclipse.papyrus.infra.nattable.tests;bundle-version="0.10.2",
+ org.eclipse.papyrus.infra.nattable.views.tests;bundle-version="0.10.2",
+ org.eclipse.papyrus.sysml.nattable.allocation.tests;bundle-version="0.10.2",
+ org.eclipse.papyrus.uml.nattable.generic.tests;bundle-version="0.10.2"
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
Bundle-Version: 0.10.2.qualifier
diff --git a/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/src/org/eclipse/papyrus/tests/extra/AllTests.java b/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/src/org/eclipse/papyrus/tests/extra/AllTests.java
index f0641cc8436..753b9840b48 100644
--- a/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/src/org/eclipse/papyrus/tests/extra/AllTests.java
+++ b/tests/junit/extraplugins/org.eclipse.papyrus.tests.extra/src/org/eclipse/papyrus/tests/extra/AllTests.java
@@ -49,14 +49,18 @@ public class AllTests {
/* **************** plugins *********************** */
/* css */
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.css.tests.tests.AllTests.class));
-
+
//nattable tests
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.tests.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.sysml.nattable.requirement.tests.tests.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.sysml.nattable.allocation.tests.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.views.tests.tests.AllTests.class));
suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.model.editor.tests.tests.AllTests.class));
-
-
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.views.tests.tests.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.nattable.tests.tests.AllTests.class));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.uml.nattable.generic.tests.tests.AllTests.class));
+
+
}
/**
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/META-INF/MANIFEST.MF b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/META-INF/MANIFEST.MF
index e2d1d795fab..ff15b488496 100644
--- a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/META-INF/MANIFEST.MF
@@ -22,3 +22,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-Description: T%Bundle-Description
+Export-Package: org.eclipse.papyrus.infra.nattable.tests.tests
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/NattableCommonTests.launch b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/NattableCommonTests.launch
index d982b1d146d..9732ed6f825 100644
--- a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/NattableCommonTests.launch
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/NattableCommonTests.launch
@@ -19,7 +19,7 @@
-
+
@@ -29,7 +29,7 @@
-
+
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/AllTests.java b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/AllTests.java
deleted file mode 100644
index b50c8135441..00000000000
--- a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/AllTests.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*****************************************************************************
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.tests;
-
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({ TableSelectionProviderTest.class })
-public class AllTests {
- // JUnit 4 test suite
-}
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/TableSelectionProviderTest.java b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/TableSelectionProviderTest.java
deleted file mode 100644
index 5e34bfb995d..00000000000
--- a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.tests/src/org/eclipse/papyrus/infra/nattable/tests/TableSelectionProviderTest.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*****************************************************************************
- * 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.tests;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.nebula.widgets.nattable.NatTable;
-import org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOffCommand;
-import org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOnCommand;
-import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
-import org.eclipse.nebula.widgets.nattable.selection.command.SelectCellCommand;
-import org.eclipse.nebula.widgets.nattable.selection.command.SelectRowsCommand;
-import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel;
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * @author VL222926
- *
- * This class tests the selection provider of the table
- *
- */
-public class TableSelectionProviderTest extends AbstractEditorTest {
-
- //TODO : this class could be refactored with other class tests used for table (reveal semantic element)
- protected Resource di;
-
- protected Resource notation;
-
- protected Resource uml;
-
- protected Table table;
-
- protected Model root;
-
-
- private INattableModelManager tableManager;
-
- private NatTable nattable;
-
- private NamedElement class1;
-
- // private NamedElement class2;
-
- private Package _package;
-
- private NamedElement nestedClass1;
-
- private NamedElement nestedClass2;
-
- /**
- *
- * Constructor.
- * This plugin test the ModelExplorerView
- */
- public TableSelectionProviderTest() {
- super();
- }
-
-
- private String modelRoot = "model";
-
- @Before
- public void initTests() throws CoreException, IOException {
- try {
- initModel("testSelectionProvider", "model", getBundle());
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- ResourceSet set = null;
- try {
- set = getModelSet();
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- final List resources = set.getResources();
-
- final StringBuffer model_uml = new StringBuffer(this.modelRoot);
- model_uml.append(".");
- model_uml.append(UmlModel.UML_FILE_EXTENSION);
- final StringBuffer model_notation = new StringBuffer(this.modelRoot);
- model_notation.append(".");
- model_notation.append(NotationModel.NOTATION_FILE_EXTENSION);
- final StringBuffer model_di = new StringBuffer(this.modelRoot);
- model_di.append(".");
- model_di.append(DiModel.DI_FILE_EXTENSION);
- for(Resource current : resources) {
- if(current.getURI().lastSegment().equals(model_uml.toString())) {
- this.uml = current;
- } else if(current.getURI().lastSegment().equals(model_notation.toString())) {
- this.notation = current;
- } else if(current.getURI().lastSegment().equals(model_di.toString())) {
- this.di = current;
- }
-
-
- }
- this.table = (Table)this.notation.getAllContents().next();
- this.root = (Model)this.uml.getContents().get(0);
-
- this.tableManager = (INattableModelManager)this.editor.getAdapter(INattableModelManager.class);
- this.nattable = (NatTable)((IAdaptable)this.tableManager).getAdapter(NatTable.class);
-
- this.class1 = this.root.getMember("Class1");
- // this.class2 = this.root.getMember("Class2");
- this._package = (Package)this.root.getMember("Package");
- this.nestedClass1 = this._package.getMember("NestedClass1");
- this.nestedClass2 = this._package.getMember("NestedClass2");
- }
-
-
- /**
- * test the selection of a single row
- */
- @Test
- public void testRowSelection() {
- SelectionLayer selectionLayer = this.tableManager.getBodyLayerStack().getSelectionLayer();
- selectionLayer.clear();
- Assert.assertTrue(getCurrentSelection().isEmpty());
- this.nattable.doCommand(new TurnViewportOffCommand());
- this.nattable.doCommand(new SelectRowsCommand(this.nattable, 2, 3, false, false));//select the row representing class1
- this.nattable.doCommand(new TurnViewportOnCommand());
- final List