Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-12 13:52:12 -0400
committerptessier2014-03-12 13:52:12 -0400
commit866c6ce3d1b324190c7c877686a7fde6ac6004c8 (patch)
treea789fc498fb144344428236c25db26feef9b6edb /tests/junit
parent1b8de31729e7cdd9be22542a0a5f7143e999d156 (diff)
downloadorg.eclipse.papyrus-866c6ce3d1b324190c7c877686a7fde6ac6004c8.tar.gz
org.eclipse.papyrus-866c6ce3d1b324190c7c877686a7fde6ac6004c8.tar.xz
org.eclipse.papyrus-866c6ce3d1b324190c7c877686a7fde6ac6004c8.zip
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2 fix bugs thnaks to tests
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/DeleteHandlerTest.java5
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/ModelExplorerViewTests.java5
2 files changed, 4 insertions, 6 deletions
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 c865bd6c371..c261cd3399e 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
@@ -25,6 +25,7 @@ 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.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
@@ -91,9 +92,7 @@ public class DeleteHandlerTest extends AbstractHandlerTest {
final IStructuredSelection currentSelection = getCurrentSelection();
Assert.assertEquals("Only one element should be selected", currentSelection.size(), 1); //$NON-NLS-1$
Object obj = currentSelection.getFirstElement();
- if(obj instanceof IAdaptable) {
- obj = ((IAdaptable)obj).getAdapter(EObject.class);
- }
+ obj = EMFHelper.getEObject(obj);
Assert.assertSame(getRootOfTheModel(), obj);
final IHandler currentHandler = getActiveHandler();
if(currentHandler == null) {
diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/ModelExplorerViewTests.java b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/ModelExplorerViewTests.java
index cf8c7180bc9..660aa92a500 100644
--- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/ModelExplorerViewTests.java
+++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/ModelExplorerViewTests.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
@@ -76,9 +77,7 @@ public class ModelExplorerViewTests extends AbstractHandlerTest {
final IStructuredSelection currentSelection = getCurrentSelection();
Assert.assertEquals("Only one element should be selected", currentSelection.size(), 1); //$NON-NLS-1$
Object obj = currentSelection.getFirstElement();
- if(obj instanceof IAdaptable) {
- obj = ((IAdaptable)obj).getAdapter(EObject.class);
- }
+ obj = EMFHelper.getEObject(obj);
Assert.assertSame("The function revealSemanticElement seems doesn't work on the root of the model", obj, getRootOfTheModel()); //$NON-NLS-1$
}

Back to the top