Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-11 07:09:37 -0400
committerptessier2014-03-11 07:09:37 -0400
commit68437b06ae1f7804b636cc7080368495072d5eb6 (patch)
treeb245cec10e5d300f1da74fd700baf51f037d9f4e /tests/junit
parent41b9fc779d6f458ae17ee3de4a2784a63eb78bb6 (diff)
downloadorg.eclipse.papyrus-68437b06ae1f7804b636cc7080368495072d5eb6.tar.gz
org.eclipse.papyrus-68437b06ae1f7804b636cc7080368495072d5eb6.tar.xz
org.eclipse.papyrus-68437b06ae1f7804b636cc7080368495072d5eb6.zip
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2 fix compilation error
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java5
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java5
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/META-INF/MANIFEST.MF
index d0fd039419a..d1f486cca15 100644
--- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/META-INF/MANIFEST.MF
@@ -15,7 +15,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
- org.junit;bundle-version="4.10.0"
+ org.junit;bundle-version="4.10.0",
+ org.eclipse.papyrus.emf.facet.custom.metamodel,
+ org.eclipse.papyrus.infra.emf
Export-Package: org.eclipse.papyrus.views.modelexplorer.tests
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java
index a700e2a5271..481420d48d7 100644
--- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java
+++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java
@@ -38,6 +38,7 @@ import org.eclipse.emf.transaction.util.TransactionUtil;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
@@ -296,9 +297,7 @@ public abstract class AbstractHandlerTest {
// store the root of the model
Object[] visibleElement = commonViewer.getVisibleExpandedElements();
- if(visibleElement[0] instanceof IAdaptable) {
- modelRoot = (EObject)((IAdaptable)visibleElement[0]).getAdapter(EObject.class);
- }
+ modelRoot = EMFHelper.getEObject(visibleElement[0]);
setStatus(Status.OK_STATUS);
}
diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java
index ab04aafea6c..c865bd6c371 100644
--- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java
+++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement;
import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EStructuralFeatureTreeElement;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
@@ -118,8 +119,8 @@ public class DeleteHandlerTest extends AbstractHandlerTest {
final Object[] expandedElement = runnable.getResult();
for(final Object object : expandedElement) {
- if(object instanceof org.eclipse.emf.facet.infra.browser.uicore.internal.model.LinkItem) {
- selectElementInTheModelexplorer((ITreeElement)object);
+ if(object instanceof EStructuralFeatureTreeElement) {
+ selectElementInTheModelexplorer((EStructuralFeatureTreeElement)object);
final IHandler handler = getActiveHandler();
if(handler != null) {
Assert.assertFalse("The handler " + handler + " is active on LinkItem, it is not the wanted behavior", handler.isEnabled()); //$NON-NLS-1$ //$NON-NLS-2$

Back to the top