Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java17
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java3
2 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
index 87fda4ad74..b71c1da62f 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java
@@ -583,6 +583,23 @@ public class TestUtil {
return viewbot;
}
+ public static void hideView(final String viewId) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
+ IViewReference[] views = workbenchPage.getViewReferences();
+ for (int i = 0; i < views.length; i++) {
+ IViewReference view = views[i];
+ if (viewId.equals(view.getId())) {
+ workbenchPage.hideView(view);
+ }
+ }
+ }
+ });
+ }
+
public static SWTBotView showHistoryView() {
return showView("org.eclipse.team.ui.GenericHistoryView");
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java
index fd118739a3..739e989729 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java
@@ -21,6 +21,7 @@ import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.common.StagingViewTester;
import org.eclipse.egit.ui.internal.repository.RepositoriesView;
+import org.eclipse.egit.ui.internal.staging.StagingView;
import org.eclipse.egit.ui.test.CommitMessageUtil;
import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.egit.ui.view.repositories.GitRepositoriesViewTestUtils;
@@ -57,6 +58,8 @@ public class StagingViewTest extends LocalRepositoryTestCase {
@After
public void after() {
+ TestUtil.hideView(RepositoriesView.VIEW_ID);
+ TestUtil.hideView(StagingView.VIEW_ID);
Activator.getDefault().getRepositoryUtil().removeDir(repositoryFile);
}

Back to the top