Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/plugin.xml7
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/adapters/CDOAdapterFactory.java32
-rw-r--r--features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java44
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java10
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java22
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/profile/ui/dialogs/RegisteredProfileSelectionDialog.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java29
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/PackageImportSourceDialog.java2
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF2
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java25
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java10
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF4
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TestMode.java42
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java144
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java49
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java38
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java39
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java53
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java10
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractPapyrusTest.java28
-rw-r--r--tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DependencyManagementTest.java10
23 files changed, 472 insertions, 139 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
index deb42190269..8dc5652121f 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/META-INF/MANIFEST.MF
@@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.0.0",
org.eclipse.papyrus.infra.services.controlmode;bundle-version="1.0.0",
org.eclipse.ui.navigator;bundle-version="3.5.300",
- org.eclipse.emf.cdo.ui.admin;bundle-version="[4.1.200,5.0.0)"
+ org.eclipse.emf.cdo.ui.admin;bundle-version="[4.1.200,5.0.0)",
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.cdo.internal.ui;x-friends:="org.eclipse.papyrus.cdo.ui.tests,org.eclipse.papyrus.cdo.uml.ui",
org.eclipse.papyrus.cdo.internal.ui.actions;x-friends:="org.eclipse.papyrus.cdo.ui.tests",
org.eclipse.papyrus.cdo.internal.ui.adapters;x-friends:="org.eclipse.papyrus.cdo.ui.tests",
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/plugin.xml b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/plugin.xml
index 9d1a0dcb6f9..e869b106acc 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/plugin.xml
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.4"?>
<!--
- Copyright (c) 2013 CEA LIST.
+ Copyright (c) 2013, 2014 CEA LIST and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
@@ -11,6 +11,7 @@
Contributors:
CEA LIST - Initial API and implementation
+ Christian W. Damus (CEA) - bug 386118
-->
@@ -117,7 +118,7 @@
name="org.eclipse.emf.ecore.EObject">
</objectClass>
<objectClass
- name="org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement">
+ name="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement">
</objectClass>
</or>
</enablement>
@@ -310,7 +311,7 @@
</adapter>
</factory>
<factory
- adaptableType="org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement"
+ adaptableType="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement"
class="org.eclipse.papyrus.cdo.internal.ui.adapters.CDOAdapterFactory">
<adapter
type="org.eclipse.emf.cdo.CDOObject">
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/adapters/CDOAdapterFactory.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/adapters/CDOAdapterFactory.java
index 5ea1b6fe245..37f8b0c6f76 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/adapters/CDOAdapterFactory.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.ui/src/org/eclipse/papyrus/cdo/internal/ui/adapters/CDOAdapterFactory.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* CEA LIST - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 386118
+ *
*****************************************************************************/
package org.eclipse.papyrus.cdo.internal.ui.adapters;
@@ -18,37 +20,38 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPart;
import org.eclipse.papyrus.cdo.internal.core.CDOUtils;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EObjectTreeElement;
/**
* This is the CDOAdapterFactory type. Enjoy.
*/
@SuppressWarnings("rawtypes")
-public class CDOAdapterFactory
- implements IAdapterFactory {
+public class CDOAdapterFactory implements IAdapterFactory {
- private final Class[] supported = {CDOObject.class};
+ private final Class[] supported = { CDOObject.class };
public CDOAdapterFactory() {
super();
}
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
EObject eObject = null;
- if (adaptableObject instanceof EditPart) {
+ if(adaptableObject instanceof EditPart) {
// notation views are important as CDOObjects for locking and
// conflict purposes, so do not defer to the semantic element
- eObject = (EObject) ((EditPart) adaptableObject).getModel();
- } else if (adaptableObject instanceof EObject) {
- eObject = (EObject) adaptableObject;
+ eObject = (EObject)((EditPart)adaptableObject).getModel();
+ } else if(adaptableObject instanceof EObjectTreeElement) {
+ eObject = ((EObjectTreeElement)adaptableObject).getEObject();
+ } else if(adaptableObject instanceof EObject) {
+ eObject = (EObject)adaptableObject;
} else {
// try really hard to get an EObject
- if (adaptableObject instanceof IAdaptable) {
- eObject = (EObject) ((IAdaptable) adaptableObject)
- .getAdapter(EObject.class);
+ if(adaptableObject instanceof IAdaptable) {
+ eObject = (EObject)((IAdaptable)adaptableObject).getAdapter(EObject.class);
}
- if (eObject == null) {
- eObject = (EObject) Platform.getAdapterManager()
- .getAdapter(adaptableObject, EObject.class);
+ if(eObject == null) {
+ eObject = (EObject)Platform.getAdapterManager().getAdapter(adaptableObject, EObject.class);
}
}
@@ -56,6 +59,7 @@ public class CDOAdapterFactory
return CDOUtils.getCDOObject(eObject);
}
+ @Override
public Class[] getAdapterList() {
return supported;
}
diff --git a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
index 9e4b255e711..fb0b34c3967 100644
--- a/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
+++ b/features/papyrus-tests-features/org.eclipse.papyrus.tests.feature/feature.xml
@@ -6,7 +6,7 @@
provider-name="%providerName">
<copyright url="http://www.eclipse.org/legal/epl-v10.html">
- Copyright (c) 2008-2012 CEA LIST, Atos Origin, Conselleria de
+ Copyright (c) 2008-2014 CEA LIST, Atos Origin, Conselleria de
Infraestructuras y Transporte, Generalitat de la Comunitat Valenciana
and others
All rights reserved. This program and the accompanying materials
@@ -65,10 +65,6 @@ http://www.eclipse.org/legal/epl-v10.html
version="0.0.0"/>
<includes
- id="org.eclipse.papyrus.tests.infra.queries.feature"
- version="0.0.0"/>
-
- <includes
id="org.eclipse.papyrus.tests.uml.tools.feature"
version="0.0.0"/>
diff --git a/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java b/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java
index 3ee7dfe0e85..61e2ffaa4b2 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.extensionpoints/src/org/eclipse/papyrus/uml/extensionpoints/utils/Util.java
@@ -29,12 +29,12 @@ public class Util {
/**
* Check if the StereotypedElement has the given stereotype.
- *
+ *
* @param stereotypeName
* name of the stereotype
* @param elt
* element to check
- *
+ *
* @return true if a stereotype whith the same name was found
*/
public static boolean hasStereotype(Element elt, String stereotypeName) {
@@ -56,7 +56,7 @@ public class Util {
/**
* Returns the resourceSet associated to the specified EObject. If no eResource is associated to
* the EObject, creates a new ResourceSet, using {@link ResourceSetImpl}.
- *
+ *
* @param eObject
* the object from which the ResourceSet is retrieved
* @return the ResourceSet in which the eObject is managed, or a new one if no resource is
@@ -84,18 +84,36 @@ public class Util {
}
}
- private static ResourceSet sharedResourceSet;
+ /**
+ * Creates and returns a temporary resource set. The resource set can be used to load libraries
+ * without polluting the current ModelSet.
+ *
+ * It is configured with XMI Load options, to allow safe loading of resources
+ *
+ * @return
+ * A temporary resource set
+ *
+ */
+ public static ResourceSet createTemporaryResourceSet() {
+ ResourceSet tmpResourceSet = new ResourceSetImpl();
- public static ResourceSet getSharedResourceSet() {
- if(sharedResourceSet == null) {
- sharedResourceSet = new ResourceSetImpl();
+ tmpResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, true);
+ tmpResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
+ tmpResourceSet.getLoadOptions().put(XMIResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
+ tmpResourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- sharedResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_ATTACHMENT, true);
- sharedResourceSet.getLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
- sharedResourceSet.getLoadOptions().put(XMIResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
- sharedResourceSet.getLoadOptions().put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- }
- return sharedResourceSet;
+ return tmpResourceSet;
+ }
+
+ /**
+ * @deprecated Share resource set never reloads resources. Use a temporary resource set instead
+ * @return
+ *
+ * @see {@link #createTemporaryResourceSet()}
+ */
+ @Deprecated
+ public static ResourceSet getSharedResourceSet() {
+ return createTemporaryResourceSet();
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
index f672005ea23..74092b86cec 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredPackageHandler.java
@@ -45,13 +45,13 @@ public class ImportRegisteredPackageHandler extends AbstractImportHandler {
/**
* Apply the result of the dialog, i.e. it adds package imports to libraries
- *
+ *
* @param librariesToImport
* the array of Libraries to import
*/
protected void importLibraries(RegisteredLibrary[] librariesToImport) {
// retrieve the current resource set
- ResourceSet resourceSet = Util.getSharedResourceSet();
+ ResourceSet resourceSet = Util.createTemporaryResourceSet();
for(int i = 0; i < librariesToImport.length; i++) {
RegisteredLibrary currentLibrary = (librariesToImport[i]);
@@ -86,7 +86,7 @@ public class ImportRegisteredPackageHandler extends AbstractImportHandler {
* <p>
* It returns all registered libraries except the already imported ones.
* </p>
- *
+ *
* @return the array of available libraries for the currently selected package
*/
protected RegisteredLibrary[] getAvailableLibraries() {
@@ -107,7 +107,7 @@ public class ImportRegisteredPackageHandler extends AbstractImportHandler {
* <p>
* It returns all already imported libraries.
* </p>
- *
+ *
* @return the array of already selected libraries for the currently selected package
*/
protected Collection<RegisteredLibrary> getImportedLibraries() {
@@ -131,7 +131,7 @@ public class ImportRegisteredPackageHandler extends AbstractImportHandler {
/**
* Creates a new ImportLibraryFromRepositoryCommand
- *
+ *
* @param editingDomain
* editing domain that manages the changed objects
* @param runnable
diff --git a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
index 640960da3ad..80e790c49cd 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.import/src/org/eclipse/papyrus/uml/importt/handlers/ImportRegisteredProfileHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -10,7 +10,7 @@
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - Refactoring package/profile import/apply UI for CDO
* Christian W. Damus (CEA) - bug 323802
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.importt.handlers;
@@ -29,8 +29,8 @@ import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.uml.extensionpoints.profile.FilteredRegisteredProfilesAsLibrarySelectionDialog;
import org.eclipse.papyrus.uml.extensionpoints.profile.RegisteredProfile;
import org.eclipse.papyrus.uml.extensionpoints.utils.Util;
-import org.eclipse.papyrus.uml.profile.ui.dialogs.ProfileTreeSelectionDialog;
import org.eclipse.papyrus.uml.profile.ui.dialogs.ElementImportTreeSelectionDialog.ImportSpec;
+import org.eclipse.papyrus.uml.profile.ui.dialogs.ProfileTreeSelectionDialog;
import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
@@ -50,16 +50,16 @@ public class ImportRegisteredProfileHandler extends AbstractImportHandler {
/**
- *
+ *
* The command to import profiles in the the model
- *
+ *
*/
public class ImportProfileCommand extends AbstractImportCommand {
/**
- *
+ *
* Constructor.
- *
+ *
* @param editingDomain
* the editing domain
*/
@@ -88,14 +88,14 @@ public class ImportRegisteredProfileHandler extends AbstractImportHandler {
/**
* Import the profiles in the model.
- *
+ *
* @param profilesToImport
* the profiles to import
*/
protected void importProfiles(RegisteredProfile[] profilesToImport) {
// retrieve the current resource set
- ResourceSet resourceSet = Util.getResourceSet(getSelectedElement());
+ ResourceSet resourceSet = Util.createTemporaryResourceSet();
for(int i = 0; i < profilesToImport.length; i++) {
RegisteredProfile currentLibrary = (profilesToImport[i]);
@@ -112,7 +112,7 @@ public class ImportRegisteredProfileHandler extends AbstractImportHandler {
while(resultIter.hasNext()) {
Package element = resultIter.next().getElement();
PackageImport ei = UMLFactory.eINSTANCE.createPackageImport();
- ei.setImportedPackage((Package)element);
+ ei.setImportedPackage(element);
//we import only once an element :
List<Package> importedPackages = ((Package)getSelectedElement()).getImportedPackages();
@@ -126,7 +126,7 @@ public class ImportRegisteredProfileHandler extends AbstractImportHandler {
/**
* Returns the list of the profiles which are already imported
- *
+ *
* @return
* the list of the profiles which are already imported
*/
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/profile/ui/dialogs/RegisteredProfileSelectionDialog.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/profile/ui/dialogs/RegisteredProfileSelectionDialog.java
index 8c876cdb4ac..e00ee4364c0 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/profile/ui/dialogs/RegisteredProfileSelectionDialog.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/profile/ui/dialogs/RegisteredProfileSelectionDialog.java
@@ -98,7 +98,7 @@ public class RegisteredProfileSelectionDialog extends FilteredRegisteredElements
// User selection
Object[] selection = this.getResult();
- ResourceSet resourceSet = Util.getSharedResourceSet();
+ ResourceSet resourceSet = Util.createTemporaryResourceSet();
if(selection == null) { // Cancel was selected
return new ArrayList<Profile>();
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
index 56b221f3d5e..1b209eef5aa 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST 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
@@ -26,6 +26,7 @@ import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
import org.eclipse.papyrus.infra.widgets.editors.ICommitListener;
import org.eclipse.papyrus.uml.tools.commands.ApplyProfileCommand;
@@ -34,9 +35,9 @@ import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.Profile;
/**
- *
+ *
* An IObservableList for Profile application
- *
+ *
* @author Camille Letavernier
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -51,9 +52,9 @@ public class ProfileApplicationObservableList extends WritableList implements IC
private AbstractStereotypeListener listener;
/**
- *
+ *
* Constructor.
- *
+ *
* @param umlSource
* The Package on which the profiles are applied or unapplied
* @param domain
@@ -130,7 +131,7 @@ public class ProfileApplicationObservableList extends WritableList implements IC
public Object getObserved() {
return umlSource;
}
-
+
@Override
public synchronized void dispose() {
super.dispose();
@@ -179,8 +180,8 @@ public class ProfileApplicationObservableList extends WritableList implements IC
//(n+1).canExecute()
//(n+1).execute()
- //Problem : this is the StrictCompoundCommand's behavior. However, in the
- //StrictCompoundCommand implementation, the execute() is called outside of
+ //Problem : this is the StrictCompoundCommand's behavior. However, in the
+ //StrictCompoundCommand implementation, the execute() is called outside of
//the current CommandStack, which is forbidden
};
@@ -216,7 +217,7 @@ public class ProfileApplicationObservableList extends WritableList implements IC
return false;
}
- Profile profile = (Profile)o;
+ Profile profile = EMFHelper.reloadIntoContext((Profile)o, umlSource);
Command command = new ApplyProfileCommand(umlSource, profile, (TransactionalEditingDomain)domain);
commands.add(command);
@@ -250,7 +251,15 @@ public class ProfileApplicationObservableList extends WritableList implements IC
//We only apply the profiles that are not applied yet (To avoid removing them when undo is called)
c.removeAll(wrappedList);
- Command command = new ApplyProfileCommand(umlSource, c, (TransactionalEditingDomain)domain);
+ Collection<Profile> profiles = new LinkedList<Profile>();
+ for(Object element : c) {
+ if(element instanceof Profile) {
+ profiles.add(EMFHelper.reloadIntoContext((Profile)element, umlSource));
+ } else {
+ throw new IllegalArgumentException("The new value should only contain profiles");
+ }
+ }
+ Command command = new ApplyProfileCommand(umlSource, profiles, (TransactionalEditingDomain)domain);
commands.add(command);
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/PackageImportSourceDialog.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/PackageImportSourceDialog.java
index fcf3bf2430d..2ee1230cb42 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/PackageImportSourceDialog.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/importsources/PackageImportSourceDialog.java
@@ -115,7 +115,7 @@ public class PackageImportSourceDialog extends MultipleValueSelectorDialog {
setLabelProvider(labelProvider);
- resourceSet = Util.getSharedResourceSet();
+ resourceSet = Util.createTemporaryResourceSet();
}
/**
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
index 0043859d9f1..5361a1602b6 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
@@ -16,8 +16,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.diagram.pkg.tests;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.usecase.tests;bundle-version="1.0.0",
org.eclipse.papyrus.uml.diagram.dnd.tests;bundle-version="1.0.0",
- org.eclipse.papyrus.core.queries.configuration.tests;bundle-version="1.0.0",
- org.eclipse.papyrus.core.queries.test;bundle-version="1.0.0",
org.eclipse.papyrus.diagram.stereotypeproperty.tests;bundle-version="1.0.0",
org.eclipse.papyrus.diagram.tests;bundle-version="1.0.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
index 8d90eb5853f..55d0b76c88a 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
@@ -22,21 +22,21 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.junit.utils.TestMode;
+import org.eclipse.papyrus.junit.utils.classification.NotImplemented;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
import org.eclipse.pde.internal.core.feature.Feature;
import org.junit.Assert;
-import org.junit.Assume;
import org.junit.Test;
import org.osgi.framework.Bundle;
/**
* suppress restriction for org.eclipse.pde.internal.core.feature.Feature;
- *
+ *
* @author VL222926
*
*/
@SuppressWarnings("restriction")
-public class BundlesTests {
+public class BundlesTests extends AbstractPapyrusTest {
// Transform the version number to the regex format
// Adds .* (Valid version numbers are e.g. 0.10.1.qualifier)
@@ -113,20 +113,18 @@ public class BundlesTests {
/**
* Tests that we don't use import package
*/
+ @NotImplemented("Usage of importPackage is discouraged")
@Test
public void importPackage() {
- Assume.assumeTrue("Usage of importPackage is discouraged", TestMode.isStrict()); //$NON-NLS-1$
-
testManifestProperty(BundleTestsUtils.BUNDLE_IMPORT_PACKAGE, "", true, false); //$NON-NLS-1$
}
/**
* This test verify that we doesn't re-export dependencies
*/
+ @NotImplemented("Usage of reexported dependencies is discouraged")
@Test
public void reexportDependencies() {
- Assume.assumeTrue("Usage of reexported dependencies is discouraged", TestMode.isStrict());
-
StringBuffer message = new StringBuffer();
int nb = 0;
for(final Bundle current : BundleTestsUtils.getPapyrusBundles()) {
@@ -163,7 +161,7 @@ public class BundlesTests {
/**
* Tests if a the value of a property in the Manifest is correct
- *
+ *
* @param property
* the property to test
* @param regex
@@ -202,7 +200,7 @@ public class BundlesTests {
/**
* Tests if the file is owned by the bundle
- *
+ *
* @param filepath
* the file path
*/
@@ -337,7 +335,7 @@ public class BundlesTests {
}
/**
- *
+ *
* @param first
* @param second
* @return <ul>
@@ -365,7 +363,7 @@ public class BundlesTests {
}
/**
- *
+ *
* @param partialDependencyName
* the fullName or a part of the name of the plugin
* @param wantedBundleVersionRegex
@@ -420,10 +418,9 @@ public class BundlesTests {
/**
* This test verify that the plugin contains pdoc file
*/
+ @NotImplemented("Documentation file is not mandatory")
@Test
public void documentationFileTest() {
- Assume.assumeTrue("It is a good practice to add a plugin.pdoc file to each plug-in", TestMode.isStrict());
-
String message = null;
int nb = 0;
for(final Bundle bundle : BundleTestsUtils.getPapyrusBundles()) {
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
index d2d3e4b59c6..ee6096aa813 100644
--- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSCompartmentsTests.java
@@ -36,11 +36,11 @@ import org.eclipse.papyrus.infra.gmfdiag.css.helper.CSSHelper;
import org.eclipse.papyrus.infra.gmfdiag.css.helper.ResetStyleHelper;
import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
import org.eclipse.papyrus.infra.gmfdiag.css.tests.Activator;
-import org.eclipse.papyrus.junit.utils.TestMode;
+import org.eclipse.papyrus.junit.utils.classification.NotImplemented;
+import org.eclipse.papyrus.junit.utils.tests.AbstractPapyrusTest;
import org.eclipse.uml2.uml.NamedElement;
import org.junit.After;
import org.junit.Assert;
-import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
@@ -49,9 +49,9 @@ import org.junit.Test;
* See resources/model/compartmentsTest/model.di for details
*
* @author Camille Letavernier
- *
+ *
*/
-public class CSSCompartmentsTests {
+public class CSSCompartmentsTests extends AbstractPapyrusTest {
public static final String CLASS_ATTRIBUTE_COMPARTMENT_TYPE = "7017"; //$NON-NLS-1$
@@ -111,9 +111,9 @@ public class CSSCompartmentsTests {
}
/* Test Enumeration1 */
+ @NotImplemented("The 'case insensitive' attributes are not supported by Eclipse E4 CSS")
@Test
public void testCaseInsensitiveForEnumeration() {
- Assume.assumeTrue("The 'case insensitive' attributes are not supported by Eclipse E4 CSS", TestMode.isStrict());
Shape enumeration = findShape("Enumeration1");
BasicCompartment compartment = findCompartment(enumeration, ENUMERATION_LITERAL_COMPARTMENT_TYPE);
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
index 51d7e76ea04..eaf7e42ec47 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/META-INF/MANIFEST.MF
@@ -15,8 +15,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.uml.tools;bundle-version="1.0.0",
org.eclipse.papyrus.editor;bundle-version="1.0.0",
org.junit;bundle-version="4.10.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0"
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.tools;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.junit.utils,
+ org.eclipse.papyrus.junit.utils.classification,
org.eclipse.papyrus.junit.utils.rules,
org.eclipse.papyrus.junit.utils.tests
Bundle-Vendor: %Bundle-Vendor
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TestMode.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TestMode.java
deleted file mode 100644
index 1cfcfb95686..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/TestMode.java
+++ /dev/null
@@ -1,42 +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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.utils;
-
-
-
-/**
- * This class is used to configure a test job. In strict mode, all tests are executed.
- * When the strict mode is disabled, the tests which are known to be failing are ignored.
- *
- * This is useful for test-driven development, when tests are implemented before the feature:
- * we can still have "green builds" (by ignoring these specific tests) and test for non-regression.
- *
- * Usage: When a test is known to be failing, add: Assume.assumeTrue("Why the test is disabled", TestMode.isStrict());
- *
- * The test will be run only in strict mode, and ignored during non-regression testing
- *
- * @author Camille Letavernier
- *
- */
-public class TestMode {
-
- private static boolean strictMode = false;
-
- public static boolean isStrict() {
- return strictMode;
- }
-
- public static void setStrict(boolean strictMode) {
- TestMode.strictMode = strictMode;
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java
new file mode 100644
index 00000000000..302e06314d9
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationConfig.java
@@ -0,0 +1,144 @@
+/*****************************************************************************
+ * 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.junit.utils.classification;
+
+import static org.eclipse.papyrus.junit.utils.classification.TestCategory.InvalidTest;
+import static org.eclipse.papyrus.junit.utils.classification.TestCategory.NotImplemented;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.papyrus.infra.tools.util.ListHelper;
+
+
+/**
+ * This class is used to configure the Classification Annotations which should be
+ * excluded from a test job.
+ *
+ * Usage:
+ *
+ * ClassificationConfig.setExcludedTestCategories(TestCategory.InvalidTest, TestCategory.NotImplemented);
+ *
+ * or
+ *
+ * ClassificationConfig.setIncludedTestCategories(TestCategory.Standard, TestCategory.NotImplemented);
+ *
+ * @author Camille Letavernier
+ *
+ * @see {@link TestCategory}
+ * @see {@link ClassificationRunner}
+ *
+ */
+public class ClassificationConfig {
+
+ public static final Set<TestCategory> excludedTestCategories = new HashSet<TestCategory>();
+
+ static {
+ setExcludedTestCategories(NotImplemented, InvalidTest);
+ }
+
+ /**
+ * Define the test categories which should be excluded from the TestSuite
+ *
+ * @param categoriesToInclude
+ */
+ public static void setExcludedTestCategories(TestCategory... categories) {
+ setExcludedTestCategories(Arrays.asList(categories));
+ }
+
+ /**
+ * Define the test categories which should be included in the TestSuite
+ *
+ * @param categoriesToInclude
+ */
+ public static void setIncludedTestCategories(TestCategory... categories) {
+ setIncludedTestCategories(Arrays.asList(categories));
+ }
+
+ /**
+ * Define the test categories which should be excluded from the TestSuite
+ *
+ * @param categoriesToInclude
+ */
+ public static void setExcludedTestCategories(Collection<TestCategory> categoriesToExclude) {
+ excludedTestCategories.clear();
+ excludedTestCategories.addAll(categoriesToExclude);
+ }
+
+ /**
+ * Define the test categories which should be included in the TestSuite
+ *
+ * @param categoriesToInclude
+ */
+ public static void setIncludedTestCategories(Collection<TestCategory> categoriesToInclude) {
+ excludedTestCategories.clear();
+ List<TestCategory> categoriesToExclude = ListHelper.asList(TestCategory.values());
+ categoriesToExclude.removeAll(categoriesToInclude);
+ excludedTestCategories.addAll(categoriesToExclude);
+ }
+
+ /**
+ * Tests whether a method containing the given set of Annotations should be executed
+ *
+ * @param annotations
+ * The annotations applied to the Method
+ * @return
+ * True if the test method should be executed, false if it should be ignored
+ */
+ public static boolean shouldRun(Annotation[] annotations) {
+ for(Annotation annotation : annotations) {
+ Class<? extends Annotation> annotationClass = annotation.annotationType();
+ if(isExcluded(annotationClass)) {
+ return false;
+ }
+ }
+
+ if(excludedTestCategories.contains(TestCategory.Standard)) {
+ for(TestCategory testCategory : TestCategory.values()) {
+ if(testCategory == TestCategory.Standard) {
+ continue;
+ }
+
+ for(Annotation annotation : annotations) {
+ if(testCategory.match(annotation.annotationType())) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Tests whether the given Annotation should be excluded
+ *
+ * @param annotationClass
+ * @return
+ */
+ public static boolean isExcluded(Class<? extends Annotation> annotationClass) {
+ for(TestCategory testCategory : excludedTestCategories) {
+ if(testCategory.match(annotationClass)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java
new file mode 100644
index 00000000000..34b8867d2cc
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/ClassificationRunner.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * 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.junit.utils.classification;
+
+import org.junit.runner.Description;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+
+/**
+ * A Test Runner which is aware of Classification-related annotations.
+ *
+ * It ignores the test methods according to their annotations, and the policy defined
+ * in {@link ClassificationConfig}
+ *
+ *
+ * @see {@link ClassificationConfig}
+ * @see {@link TestCategory}
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class ClassificationRunner extends BlockJUnit4ClassRunner {
+
+ public ClassificationRunner(Class<?> klass) throws InitializationError {
+ super(klass);
+ }
+
+ @Override
+ protected void runChild(FrameworkMethod method, RunNotifier notifier) {
+ if(ClassificationConfig.shouldRun(method.getAnnotations())) {
+ super.runChild(method, notifier);
+ } else {
+ Description description = describeChild(method);
+ notifier.fireTestIgnored(description);
+ }
+ }
+
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java
new file mode 100644
index 00000000000..625726d7239
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/InvalidTest.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * 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.junit.utils.classification;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that a test may fail because it is not properly implemented
+ * (e.g. not compatible with Hudson, because it opens some blocking dialogs)
+ *
+ * This annotation must be used with the {@link ClassificationRule}
+ *
+ * @author Camille Letavernier
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface InvalidTest {
+
+ /**
+ * A specific message explaining why this test may be invalid
+ *
+ * @return
+ */
+ String value() default "";
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java
new file mode 100644
index 00000000000..ab51c1ae20b
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/NotImplemented.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * 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.junit.utils.classification;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that a test may fail because the tested feature
+ * is not yet implemented (Test-driven development)
+ *
+ * This annotation must be used with the {@link ClassificationRule}
+ *
+ * @author Camille Letavernier
+ *
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface NotImplemented {
+
+ /**
+ * A specific message explaining what needs to be implemented
+ * for this test to run
+ *
+ * @return
+ */
+ String value() default "";
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java
new file mode 100644
index 00000000000..1ac992884da
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/classification/TestCategory.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * 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.junit.utils.classification;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * Enumerates all available TestCategories
+ *
+ * @author Camille Letavernier
+ *
+ */
+public enum TestCategory {
+
+ /**
+ * Test methods annotated with {@link NotImplemented}
+ */
+ NotImplemented(NotImplemented.class),
+
+ /**
+ * Test methods annotated with {@link InvalidTest}
+ */
+ InvalidTest(InvalidTest.class),
+
+ /**
+ * Test methods without any classification-related annotation
+ */
+ Standard();
+
+ private Class<? extends Annotation> annotationClass;
+
+ private TestCategory() {
+ //Empty constructor for Standard
+ }
+
+ private TestCategory(Class<? extends Annotation> annotationClass) {
+ this.annotationClass = annotationClass;
+ }
+
+ public boolean match(Class<? extends Annotation> annotationClass) {
+ return annotationClass == this.annotationClass;
+ }
+
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java
index a5f4b1ccb65..fc071fb82b4 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractEditorTest.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -31,14 +31,14 @@ import org.junit.Assert;
import org.osgi.framework.Bundle;
-public abstract class AbstractEditorTest {
+public abstract class AbstractEditorTest extends AbstractPapyrusTest {
protected IMultiDiagramEditor editor;
protected IProject project;
/**
- *
+ *
* @return
* the current bundle
*/
@@ -49,7 +49,7 @@ public abstract class AbstractEditorTest {
/**
* Inits this.editor
* Fails or throws an exception if an error occurs
- *
+ *
* @param bundle
* TODO
*/
@@ -108,7 +108,7 @@ public abstract class AbstractEditorTest {
/**
* The path to the source model folder
- *
+ *
* @return
*/
protected abstract String getSourcePath();
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractPapyrusTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractPapyrusTest.java
new file mode 100644
index 00000000000..7e288db0596
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/tests/AbstractPapyrusTest.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * 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.junit.utils.tests;
+
+import org.eclipse.papyrus.junit.utils.classification.ClassificationRunner;
+import org.junit.runner.RunWith;
+
+/**
+ * An abstract class which should be extended by all Papyrus tests
+ *
+ * It provides generic support for papyrus-specific annotations (e.g. ClassificationRunner)
+ *
+ * @author Camille Letavernier
+ *
+ */
+@RunWith(ClassificationRunner.class)
+public abstract class AbstractPapyrusTest {
+
+}
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DependencyManagementTest.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DependencyManagementTest.java
index 36d89cc8e52..8a9935779f1 100644
--- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DependencyManagementTest.java
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DependencyManagementTest.java
@@ -23,7 +23,7 @@ import org.eclipse.papyrus.infra.emf.resource.DependencyManagementHelper;
import org.eclipse.papyrus.junit.utils.ModelUtils;
import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
import org.eclipse.papyrus.junit.utils.ProjectUtils;
-import org.eclipse.papyrus.junit.utils.TestMode;
+import org.eclipse.papyrus.junit.utils.classification.NotImplemented;
import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
import org.eclipse.papyrus.uml.tools.tests.Activator;
import org.eclipse.uml2.uml.Model;
@@ -32,16 +32,15 @@ import org.eclipse.uml2.uml.Profile;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.util.UMLUtil;
import org.junit.Assert;
-import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
/**
* Test case for DependencyManagementHelper
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class DependencyManagementTest extends AbstractEditorTest {
@@ -111,9 +110,8 @@ public class DependencyManagementTest extends AbstractEditorTest {
//Problem: !!Stereotypes are not references!! They are instances. After the switch, the new
//profile is correctly applied, but the applied Stereotypes are the ones from the initial Profile
@Test
+ @NotImplemented("Bug 408491 is not yet implemented")
public void testSwitchProfilesWithStereotypes() throws Exception {
- Assume.assumeTrue("Bug 408491 is not yet implemented", TestMode.isStrict());
-
IProject project = ProjectUtils.createProject("dependencyManagement.switchProfiles");
PapyrusProjectUtils.copyPapyrusModel(project, getBundle(), getSourcePath(), "profiles/model");
PapyrusProjectUtils.copyPapyrusModel(project, getBundle(), getSourcePath(), "profiles/p1/profile1.profile");

Back to the top