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/common/EGitTestCase.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/EGitTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/EGitTestCase.java
index 190feddfce..d7826dc3b4 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/EGitTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/EGitTestCase.java
@@ -11,12 +11,16 @@
*******************************************************************************/
package org.eclipse.egit.ui.common;
+import static org.junit.Assert.fail;
+
import org.eclipse.egit.ui.test.Eclipse;
import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
@@ -40,6 +44,18 @@ public abstract class EGitTestCase {
}
}
+ @Before
+ public void activateShell() {
+ SWTBotShell[] shells = bot.shells();
+ for (SWTBotShell shell : shells) {
+ if (Eclipse.isEclipseShell(shell)) {
+ shell.activate();
+ return;
+ }
+ }
+ fail("No active Eclipse shell found!");
+ }
+
@After
public void resetWorkbench() {
new Eclipse().reset();

Back to the top