Skip to main content
diff options
authorRobin Stocker2013-10-19 23:53:56 +0000
committerMatthias Sohn2013-10-22 13:38:17 +0000
commitfed21849f6a0fc2003a30bc036cefbbdf428a8cb (patch)
tree7adbfbfb4309e6b5664dd40b6b36d54e845becb9 /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history
parent448b9ac17151d750e0389b41c20f6800fc568406 (diff)
Fix UI tests interfering with each other because of shared test setup
The most common cause of unstable UI tests was that the test data (repositories and projects) was set up once per class, and then each test method used the same data. When one test method only reads the data but another modifies it, the test may fail depending on the order of execution. This is an attempt to fix this by changing the test setup so that it's done once per test method (@Before instead of @BeforeClass). To make it easier (and possibly faster) to clean up and reduce the possibility of accidentally sharing the data, the data for each test method is created in a separate directory. Change-Id: I2d7ae4e86c08483a1e8a2824a31648f9d6827bf8 Signed-off-by: Robin Stocker <>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history')
1 files changed, 5 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/
index 3d0c046a4..bb91cda3b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/
@@ -45,7 +45,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.junit.BeforeClass;
+import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -58,13 +58,12 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
private static final String ADDEDMESSAGE = "A new file in a new folder";
- private static int commitCount;
+ private int commitCount;
- private static File repoFile;
+ private File repoFile;
- @BeforeClass
- public static void setup() throws Exception {
- // File repoFile =
+ @Before
+ public void setup() throws Exception {
repoFile = createProjectAndCommitToRepository();
IProject prj = ResourcesPlugin.getWorkspace().getRoot()

Back to the top