Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-07-07 19:19:29 +0000
committerAndrey Loskutov2015-07-07 19:20:48 +0000
commite003dd221f10a6a2e1bdb60c5cc641bcb0aaf825 (patch)
tree2ee55aa3f2b145c9b12373af6587e837be2b20f8 /org.eclipse.egit.ui.test
parent6b3b1f075c64e731166975e7050bdcb8d7de8804 (diff)
downloadegit-e003dd221f10a6a2e1bdb60c5cc641bcb0aaf825.tar.gz
egit-e003dd221f10a6a2e1bdb60c5cc641bcb0aaf825.tar.xz
egit-e003dd221f10a6a2e1bdb60c5cc641bcb0aaf825.zip
Test stability: force shell activation before tests starts
Change-Id: I31a31d63a8872d1d05ecd3febc272c461dd8c414 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
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