Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-12-07 20:43:27 -0500
committerspingel2009-12-07 20:43:27 -0500
commit983a4790b4c7a5f16f1e86cb0eb659395ed7b3de (patch)
tree62764b1db3854adbbacd5621d62c748e8f851330
parentb77b87f60127826d51503de3b0c6ddf00c4f40df (diff)
downloadorg.eclipse.mylyn.tasks-983a4790b4c7a5f16f1e86cb0eb659395ed7b3de.tar.gz
org.eclipse.mylyn.tasks-983a4790b4c7a5f16f1e86cb0eb659395ed7b3de.tar.xz
org.eclipse.mylyn.tasks-983a4790b4c7a5f16f1e86cb0eb659395ed7b3de.zip
NEW - bug 296894: [releng] fix failing tests for 3.4
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296894
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/ContextPerspectiveManagerTest.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/ContextPerspectiveManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/ContextPerspectiveManagerTest.java
index 07e710f59..e116450ab 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/ContextPerspectiveManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/ContextPerspectiveManagerTest.java
@@ -17,9 +17,9 @@ import org.eclipse.mylyn.context.tests.support.ContextTestUtil;
import org.eclipse.mylyn.internal.context.ui.ContextUiPlugin;
import org.eclipse.mylyn.internal.context.ui.IContextUiPreferenceContstants;
import org.eclipse.mylyn.internal.tasks.core.TaskTask;
-import org.eclipse.mylyn.monitor.ui.MonitorUi;
import org.eclipse.mylyn.tasks.tests.TaskTestUtil;
import org.eclipse.mylyn.tasks.ui.TasksUi;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
@@ -52,7 +52,7 @@ public class ContextPerspectiveManagerTest extends TestCase {
}
public void testRestorePerspective() throws Exception {
- PlatformUI.getWorkbench().showPerspective(ID_RESOURCE_PERSPECTIVE, MonitorUi.getLaunchingWorkbenchWindow());
+ PlatformUI.getWorkbench().showPerspective(ID_RESOURCE_PERSPECTIVE, getWorkbenchWindow());
assertEquals(ID_RESOURCE_PERSPECTIVE, getActivePerspective());
TaskTask task = TaskTestUtil.createMockTask("1");
@@ -61,7 +61,7 @@ public class ContextPerspectiveManagerTest extends TestCase {
assertEquals(ID_RESOURCE_PERSPECTIVE, getActivePerspective());
// check if previous perspective is restored on deactivation
- PlatformUI.getWorkbench().showPerspective(ID_PLANNING_PERSPECTIVE, MonitorUi.getLaunchingWorkbenchWindow());
+ PlatformUI.getWorkbench().showPerspective(ID_PLANNING_PERSPECTIVE, getWorkbenchWindow());
assertEquals(ID_PLANNING_PERSPECTIVE, getActivePerspective());
TasksUi.getTaskActivityManager().deactivateActiveTask();
assertEquals(ID_RESOURCE_PERSPECTIVE, getActivePerspective());
@@ -90,8 +90,14 @@ public class ContextPerspectiveManagerTest extends TestCase {
// assertEquals(ID_RESOURCE_PERSPECTIVE, getActivePerspective());
// }
+ private IWorkbenchWindow getWorkbenchWindow() {
+ IWorkbenchWindow window = ContextUiPlugin.getPerspectiveManager().getWorkbenchWindow();
+ assertNotNull(window);
+ return window;
+ }
+
private String getActivePerspective() {
- return MonitorUi.getLaunchingWorkbenchWindow().getActivePage().getPerspective().getId();
+ return getWorkbenchWindow().getActivePage().getPerspective().getId();
}
}

Back to the top