From f739332036b8c85fb8158fdae6d274f433eb91ac Mon Sep 17 00:00:00 2001 From: Camille Letavernier Date: Fri, 25 Jul 2014 17:01:34 +0200 Subject: [Deprecated] Remove org.eclipse.papyrus.paletteconfiguration.tests --- .../.classpath | 7 - .../.project | 28 --- .../.settings/org.eclipse.jdt.core.prefs | 8 - .../ExtendedPluginPaletteProviderTests.launch | 42 ---- .../META-INF/MANIFEST.MF | 18 -- .../about.html | 28 --- .../build.properties | 8 - .../icons/debug.gif | Bin 348 -> 0 bytes .../icons/testIcon.png | Bin 498 -> 0 bytes .../model/Test1.extendedtypes | 194 ---------------- .../Test1.modifysemanticvaluesactionconfiguration | 11 - .../model/Test1.paletteconfiguration | 47 ---- .../plugin.xml | 33 --- ...dPluginPaletteProviderTests_PapyrusService.java | 137 ----------- ...etteProviderTests_LoadPaletteConfiguration.java | 112 --------- ...letteProviderTests_RetrievePredefinedEntry.java | 258 --------------------- .../paletteconfiguration/tests/ITestConstants.java | 28 --- 17 files changed, 959 deletions(-) delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/plugin.xml delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java delete mode 100644 tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath deleted file mode 100644 index 2d1a4302f04..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project deleted file mode 100644 index 2a9eddc275d..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.paletteconfiguration.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d11fadad096..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Oct 27 15:30:49 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch deleted file mode 100644 index e2ec300248c..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 9641ac97c27..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.junit;bundle-version="4.10.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.0.0", - org.eclipse.papyrus.infra.extendedtypes;bundle-version="1.0.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", - org.eclipse.gmf.runtime.common.ui.services;bundle-version="1.7.0", - org.eclipse.papyrus.uml.diagram.paletteconfiguration;bundle-version="1.0.0", - org.eclipse.gef;bundle-version="3.9.100", - org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.8.0" -Bundle-Vendor: Eclipse Modeling Project -Bundle-Version: 1.0.0.qualifier -Bundle-Name: Tests fragment for palette configuration plugin -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.paletteconfiguration.tests;si - ngleton:=true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-ActivationPolicy: lazy - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

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 http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

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 http://www.eclipse.org.

- - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties deleted file mode 100644 index 8cef9b02741..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - icons/,\ - model/,\ - plugin.xml,\ - about.html diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif deleted file mode 100644 index ac5431fa311..00000000000 Binary files a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif and /dev/null differ diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png deleted file mode 100644 index be8651ef953..00000000000 Binary files a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png and /dev/null differ diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes deleted file mode 100644 index b305b732476..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes +++ /dev/null @@ -1,194 +0,0 @@ - - - - - org.eclipse.papyrus.uml.diagram.clazz.Class_2008 - - - - - - - - - - - - - Standard - - - - - - org.eclipse.papyrus.uml.diagram.clazz.Class_3004 - - - - - - - - - - - - - Standard - - - - - - org.eclipse.papyrus.uml.diagram.clazz.Class_3008 - - - - - - - - - - - - - Standard - - - - - - org.eclipse.papyrus.uml.diagram.clazz.Class_3010 - - - - - - - - - - - - - Standard - - - - - - org.eclipse.papyrus.uml.diagram.clazz.Class_3014 - - - - - - - - - - - - - Standard - - - - - - org.eclipse.papyrus.uml.Class - - - - - - - - - - - org.eclipse.papyrus.uml.Class - - - - - - - - - - - org.eclipse.papyrus.uml.Class - - - - - - - - - - - org.eclipse.papyrus.uml.Class - - - - - - - - - - - org.eclipse.papyrus.uml.Class - - - - - - - - - - - org.eclipse.papyrus.uml.Dependency - - - - - org.eclipse.papyrus.uml.Dependency - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration deleted file mode 100644 index f99ecedf351..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration deleted file mode 100644 index 9af3663e881..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/plugin.xml b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/plugin.xml deleted file mode 100644 index 91bf862e110..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/plugin.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java deleted file mode 100644 index ed7ec7c5b3b..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java +++ /dev/null @@ -1,137 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.paletteconfiguration.tests; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.HashMap; -import java.util.List; - -import org.eclipse.gef.palette.PaletteRoot; -import org.eclipse.gmf.runtime.common.core.service.IProvider; -import org.eclipse.gmf.runtime.common.core.service.Service; -import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.PaletteToolEntry; -import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteStack; -import org.eclipse.papyrus.uml.diagram.common.service.ExtendedPluginPaletteProvider; -import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService; -import org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * Tests the usage of the extended palette provider in the {@link PapyrusPaletteService} - */ -public class EXtendedPluginPaletteProviderTests_PapyrusService implements ITestConstants { - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#contributeToPalette(org.eclipse.ui.IEditorPart, java.lang.Object, org.eclipse.gef.palette.PaletteRoot, java.util.Map)} - * . - */ - @Test - public final void testContributeToPalette() { - List descriptors = PapyrusPaletteService.getInstance().getProviders(); - - ExtendedPluginPaletteProvider extendedProvider = null; - // check the test descriptor is in the list - for(Service.ProviderDescriptor descriptor : descriptors) { - IProvider provider = descriptor.getProvider(); - if(provider instanceof ExtendedPluginPaletteProvider) { - ExtendedPluginPaletteProvider extendedPluginPaletteProvider = (ExtendedPluginPaletteProvider)provider; - List contributions = extendedPluginPaletteProvider.getContributions(); - if(contributions != null && !contributions.isEmpty()) { - String id = contributions.get(0).getId(); - if(PALETTE_TEST1_ID.equals(id)) { - extendedProvider = extendedPluginPaletteProvider; - } - } - } - } - - assertNotNull("Provider for Test1 has not been found", extendedProvider); - - PaletteRoot root = new PaletteRoot(); - extendedProvider.contributeToPalette(null, null, root, new HashMap()); - - //check root now - List rootChildren = root.getChildren(); - assertNotNull("Root children should not be null", rootChildren); - Assert.assertEquals("Root children should be size 1", 1, rootChildren.size()); // one drawer is contributed - - for(Object drawer : rootChildren) { - assertTrue("Child of the root is not a drawer: " + drawer, drawer instanceof org.eclipse.gef.palette.PaletteDrawer); - List toolsAndStack = ((org.eclipse.gef.palette.PaletteDrawer)drawer).getChildren(); - Assert.assertEquals("Drawer should have 4 children: 1 stack and 3 tools.", 4, toolsAndStack.size()); - - Object tool0 = toolsAndStack.get(0); - assertTrue("first element should be a Tool", tool0 instanceof PaletteToolEntry); - assertTrue("first element should have id palettetest1.tool0", ((PaletteToolEntry)tool0).getId().equals("palettetest1.tool0")); - assertTrue("first element should have label MetaClass", ((PaletteToolEntry)tool0).getLabel().equals("MetaClass")); - - Object tool1 = toolsAndStack.get(1); - assertTrue("first element should be a Tool", tool1 instanceof PaletteToolEntry); - Assert.assertEquals("first element should have id palettetest2.class", "palettetest2.class", ((PaletteToolEntry)tool1).getId()); - Assert.assertEquals("first element should have label Abstract Class", "Abstract Class", ((PaletteToolEntry)tool1).getLabel()); - - Object stack1 = toolsAndStack.get(2); - assertTrue("2nd element should be a Stack", stack1 instanceof PaletteStack); - assertTrue("2nd element should have id palettetest1.stack1", ((PaletteStack)stack1).getId().equals("palettetest1.stack1")); - assertTrue("2nd element should have label Stack 1", ((PaletteStack)stack1).getLabel().equals("Stack 1")); - - List stackChildren = ((PaletteStack)stack1).getChildren(); - assertTrue("Stack should have 2 children: 2 tools. but has " + stackChildren.size() + " child(ren).", stackChildren.size() == 3); - Object stackChild = stackChildren.get(0); - assertTrue("stack should be a tool", stackChild instanceof PaletteToolEntry); - assertTrue("tool should have id palettetest1.operation but is " + ((PaletteToolEntry)stackChild).getId(), ((PaletteToolEntry)stackChild).getId().equals("palettetest1.operation")); - assertTrue("first element should have label \"Operation\" but is " + ((PaletteToolEntry)stackChild).getLabel(), ((PaletteToolEntry)stackChild).getLabel().equals("Operation")); - - stackChild = stackChildren.get(1); - assertTrue("stack should be a tool", stackChild instanceof PaletteToolEntry); - assertTrue("tool should have id palettetest1.property but is " + ((PaletteToolEntry)stackChild).getId(), ((PaletteToolEntry)stackChild).getId().equals("palettetest1.property")); - assertTrue("first element should have label \"Property\" but is " + ((PaletteToolEntry)stackChild).getLabel(), ((PaletteToolEntry)stackChild).getLabel().equals("Property")); - - - Object tool3 = toolsAndStack.get(3); - assertTrue("3rd element should be a Tool", tool3 instanceof PaletteToolEntry); - assertTrue("3rd element should have id palettetest1.tool3", ((PaletteToolEntry)tool3).getId().equals("palettetest1.tool3")); - assertTrue("3rd element should have label \"Dependency\", but is " + ((PaletteToolEntry)tool3).getLabel(), ((PaletteToolEntry)tool3).getLabel().equals("Dependency")); - - } - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java deleted file mode 100644 index 3a506e2cb9a..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.paletteconfiguration.tests; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Collection; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.uml.diagram.common.service.ExtendedPluginPaletteProvider; -import org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteConfiguration; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * Tests cases for the operation load palette configuration - */ -public class ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration extends ExtendedPluginPaletteProvider implements ITestConstants { - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)}. - */ - @Test - public final void testLoadConfigurationModel_Test1InPlugin() { - Collection result = null; - try { - result = loadConfigurationModel(Platform.getBundle(BUNDLE_ID), "model/Test1.paletteconfiguration"); - } catch (FileNotFoundException e) { - fail("Exception: " + e.getMessage()); - } catch (IOException e) { - fail("I/O Exception: " + e.getMessage()); - } - assertNotNull("Collection should not be null", result); - assertTrue("Collection should return one, and only one element, not :" + result.size(), result.size() == 1); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)} - * . - */ - @Test - public final void testLoadConfigurationModel_Test1InFragmentItself() { - Collection result = null; - try { - result = loadConfigurationModel(Platform.getBundle(FRAGMENT_ID), "model/Test1.paletteconfiguration"); - } catch (FileNotFoundException e) { - fail("Exception: " + e.getMessage()); - } catch (IOException e) { - fail("I/O Exception: " + e.getMessage()); - } - assertNotNull("Collection should not be null", result); - assertTrue("Collection should return one, and only one element, not :" + result.size(), result.size() == 1); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)} - * . - */ - @Test - public final void testLoadConfigurationModel_NotExistingFile() { - Collection result = null; - try { - result = loadConfigurationModel(Platform.getBundle(FRAGMENT_ID), "model/NoConfiguration.paletteconfiguration"); - } catch (FileNotFoundException e) { - // this should come here - } catch (IOException e) { - fail("I/O Exception: " + e.getMessage()); - } - assertNull("Collection should be null", result); - } - -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java deleted file mode 100644 index 262573c6c33..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java +++ /dev/null @@ -1,258 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.paletteconfiguration.tests; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.PaletteToolEntry; -import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteDrawer; -import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteStack; -import org.eclipse.papyrus.uml.diagram.common.service.ExtendedPluginPaletteProvider; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * Test Class for {@link ExtendedPluginPaletteProvider#retrieveExistingEntry} method - */ -public class ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry extends ExtendedPluginPaletteProvider { - - /** id of drawer n°1 */ - protected static final String DRAWER1_ID = "drawer1"; //$NON-NLS-1$ - - /** id of drawer n°2 */ - protected static final String DRAWER2_ID = "drawer2"; //$NON-NLS-1$ - - /** id of drawer not existing */ - protected static final String DRAWER_NO_ID = "drawerNot"; //$NON-NLS-1$ - - /** id of stack n°1 */ - protected static final String STACK1_ID = "stack1"; //$NON-NLS-1$ - - /** id of stack not existing */ - protected static final String STACK_NO_ID = "stackNot"; //$NON-NLS-1$ - - /** id of tool n°1 */ - protected static final String TOOL1_ID = "tool1"; //$NON-NLS-1$ - - /** id of tool not existing */ - protected static final String TOOL_NO_ID = "toolNot"; //$NON-NLS-1$ - - /** id of object n°1 */ - protected static final String OBJECT1_ID = "object1"; //$NON-NLS-1$ - - /** map used for the tests */ - private static Map predefinedEntries; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - predefinedEntries = new HashMap(); - addDrawer(DRAWER1_ID); - addDrawer(DRAWER2_ID); - addTool(TOOL1_ID); - addStack(STACK1_ID); - addObject(OBJECT1_ID); - } - - /** - * Adds an undefined object to the predefined entries - * - * @param id - * id of the object - */ - private static void addObject(String id) { - predefinedEntries.put(id, new Object()); - } - - /** - * adds a stack to the predefined entries - * - * @param id - * id of the stack - */ - private static void addStack(String id) { - PaletteStack stack = new PaletteStack(id, id, id, null); - predefinedEntries.put(id, stack); - } - - /** - * adds a tool to the predefined entries - * - * @param id - * id of the tool - */ - private static void addTool(String id) { - PaletteToolEntry entry = new PaletteToolEntry(id, id, null); - predefinedEntries.put(id, entry); - } - - /** - * adds a drawer to the predefined entries - * - * @param id - * id of the drawer - */ - private static void addDrawer(String id) { - PaletteDrawer drawer = new PaletteDrawer(id, id); - predefinedEntries.put(id, drawer); - } - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveExistingDrawer() { - Object value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteDrawer.class); - - assertNotNull(DRAWER1_ID + "should be found", value); - assertTrue(DRAWER1_ID + "should be a GMF PaletteDrawer, but is :" + value.getClass().getName(), value instanceof PaletteDrawer); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveNotExistingDrawer() { - Object value = retrieveExistingEntry(predefinedEntries, DRAWER_NO_ID, PaletteDrawer.class); - - assertNull("No drawer should be found, but found: " + value, value); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveExistingStack() { - Object value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteStack.class); - - assertNotNull(STACK1_ID + "should be found", value); - assertTrue(STACK1_ID + "should be a GMF PaletteStack, but is :" + value.getClass().getName(), value instanceof PaletteStack); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveNonExistingStack() { - Object value = retrieveExistingEntry(predefinedEntries, STACK_NO_ID, PaletteStack.class); - - assertNull("No stack should be found, but found: " + value, value); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveExistingTool() { - Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteToolEntry.class); - - assertNotNull(TOOL1_ID + "should be found", value); - assertTrue(TOOL1_ID + "should be a GMF PaletteToolEntry, but is :" + value.getClass().getName(), value instanceof PaletteToolEntry); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveNonExistingTool() { - Object value = retrieveExistingEntry(predefinedEntries, TOOL_NO_ID, PaletteToolEntry.class); - - assertNull("No toolentry should be found, but found: " + value, value); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveWrongTypedElement_DrawerClass() { - Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteDrawer.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteDrawer.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteDrawer.class); - assertNull("value should be null, as not from correct type: " + value, value); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveWrongTypedElement_StackClass() { - Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteStack.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteStack.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteStack.class); - assertNull("value should be null, as not from correct type: " + value, value); - } - - /** - * Test method for - * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)} - * . - */ - @Test - public final void testRetrieveExistingEntry_retrieveWrongTypedElement_ToolClass() { - Object value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteToolEntry.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteToolEntry.class); - assertNull("value should be null, as not from correct type: " + value, value); - - value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteToolEntry.class); - assertNull("value should be null, as not from correct type: " + value, value); - } -} diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java deleted file mode 100644 index ccd18320ccc..00000000000 --- a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 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: - * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation - *****************************************************************************/ -package org.eclipse.papyrus.paletteconfiguration.tests; - - -/** - * Interface that holds constants for the test - */ -public interface ITestConstants { - - /** fragment id */ - public final static String FRAGMENT_ID = "org.eclipse.papyrus.paletteconfiguration.tests"; - - /** bundle id */ - public final static String BUNDLE_ID = "org.eclipse.papyrus.uml.diagram.paletteconfiguration"; - - /** id of the test 1 configuration */ - public static final String PALETTE_TEST1_ID = "org.eclipse.papyrus.paletteconfiguration.tests.palettetest1"; -} -- cgit v1.2.3