Author: scabanovich
Date: 2011-11-17 18:14:03 -0500 (Thu, 17 Nov 2011)
New Revision: 36426
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
Log:
JBIDE-10193
https://issues.jboss.org/browse/JBIDE-10193
Perspective test should not open new window.
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-11-17
22:38:39 UTC (rev 36425)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-11-17
23:14:03 UTC (rev 36426)
@@ -15,10 +15,12 @@
import junit.framework.TestCase;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.jboss.tools.common.ui.JBossPerspectiveFactory;
-import org.jboss.tools.test.util.WorkbenchUtils;
/**
* @author Alexey Kazakov
@@ -30,7 +32,9 @@
* @throws WorkbenchException
*/
public void testJEEPerspective() throws WorkbenchException {
- IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage("org.eclipse.jst.j2ee.J2EEPerspective",
null);
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page =
workbench.showPerspective("org.eclipse.jst.j2ee.J2EEPerspective", window);
assertNotNull(page);
assertShortcuts(page);
}
@@ -41,7 +45,9 @@
* @throws WorkbenchException
*/
public void testJBossPerspective() throws WorkbenchException {
- IWorkbenchPage page =
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID,
null);
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbench.showPerspective(JBossPerspectiveFactory.PERSPECTIVE_ID,
window);
assertNotNull(page);
assertShortcuts(page);
}