Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-26 11:12:56 -0400
committerptessier2014-03-26 11:12:56 -0400
commit45dca4c7abfca20e7dde7de0fc997deaa8b0f40d (patch)
tree0930e05204411bb31c60d122c53cd5e5327eff67 /tests/junit
parent850c5fa883451b39c333759e86bdb4a0d0809830 (diff)
parent95db010923165701ebc5b4f36ac663370b056a87 (diff)
downloadorg.eclipse.papyrus-45dca4c7abfca20e7dde7de0fc997deaa8b0f40d.tar.gz
org.eclipse.papyrus-45dca4c7abfca20e7dde7de0fc997deaa8b0f40d.tar.xz
org.eclipse.papyrus-45dca4c7abfca20e7dde7de0fc997deaa8b0f40d.zip
Merge remote-tracking branch 'gitlab/committers/bma/modelexplorertest'
Conflicts: tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/META-INF/MANIFEST.MF tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java7
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractDualHandlerTest.java6
-rw-r--r--tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java4
3 files changed, 7 insertions, 10 deletions
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java
index 9a69d6427f5..94aca47bd96 100644
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/ModelExplorerViewTests.java
@@ -16,11 +16,11 @@ package org.eclipse.papyrus.uml.modelexplorer.tests;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.common.util.EList;
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.papyrus.views.modelexplorer.tests.AbstractHandlerTest;
import org.eclipse.swt.widgets.Display;
@@ -66,7 +66,7 @@ public class ModelExplorerViewTests extends AbstractHandlerTest {
final IStructuredSelection currentSelection = getCurrentSelection();
Assert.assertEquals("Only one element should be selected", 1, currentSelection.size()); //$NON-NLS-1$
Object obj = currentSelection.getFirstElement();
- obj =org.eclipse.papyrus.infra.emf.utils.EMFHelper.getEObject(obj);
+ obj =EMFHelper.getEObject(obj);
Assert.assertEquals("The function revealSemanticElement seems doesn't work on the root of the model", getRootOfTheModel(), obj);
}
@@ -172,7 +172,7 @@ public class ModelExplorerViewTests extends AbstractHandlerTest {
final IStructuredSelection currentSelection = getCurrentSelection();
Assert.assertEquals("I don't get the correct selection", 1, currentSelection.size()); //$NON-NLS-1$
Object obj = currentSelection.getFirstElement();
- obj =org.eclipse.papyrus.infra.emf.utils.EMFHelper.getEObject(obj);
+ obj =EMFHelper.getEObject(obj);
Assert.assertEquals("The function revealSemanticElement seems doesn't work with importedPackage", current, obj);
}
}
@@ -220,3 +220,4 @@ public class ModelExplorerViewTests extends AbstractHandlerTest {
Assert.assertEquals("I don't get the current selection for revealSemanticElement_importedPackageList", 1, currentSelection.size()); //$NON-NLS-1$
}
}
+
diff --git a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractDualHandlerTest.java b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractDualHandlerTest.java
index 14be65db9f6..023d3dcd457 100644
--- a/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractDualHandlerTest.java
+++ b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractDualHandlerTest.java
@@ -24,7 +24,6 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
@@ -33,6 +32,7 @@ import org.eclipse.emf.transaction.RunnableWithResult;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.emf.facet.util.core.internal.exported.FileUtils;
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;
@@ -155,9 +155,7 @@ public abstract class AbstractDualHandlerTest extends 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/AbstractHandlerTest.java b/tests/junit/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer.tests/src/org/eclipse/papyrus/views/modelexplorer/tests/AbstractHandlerTest.java
index 27ae25a52cb..de229a128f4 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
@@ -25,7 +25,6 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
@@ -193,8 +192,7 @@ public abstract class AbstractHandlerTest {
IStructuredSelection currentSelection = (IStructuredSelection)selectionService.getSelection();
Assert.assertEquals("Only one element should be selected", 1, currentSelection.size()); //$NON-NLS-1$
Object obj = currentSelection.getFirstElement();
-
- obj = EMFHelper.getEObject(obj);
+ obj = EMFHelper.getEObject(obj);
Assert.assertSame("the current selected element is not the wanted element", elementToSelect, obj); //$NON-NLS-1$
}

Back to the top