Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Lay2010-05-28 07:17:19 +0000
committerMatthias Sohn2010-05-28 07:17:19 +0000
commit1c73580631c11fb76b8b73ec4e037b303e2a5a67 (patch)
treeaaee49e8a4df3c5b9da72e34d77a117b44f7676b
parentcae637132264628a5fea9eee0da9ee9f637d63be (diff)
downloadegit-1c73580631c11fb76b8b73ec4e037b303e2a5a67.tar.gz
egit-1c73580631c11fb76b8b73ec4e037b303e2a5a67.tar.xz
egit-1c73580631c11fb76b8b73ec4e037b303e2a5a67.zip
Fix SWTBot test: Use ceiling directory
The SharingWizardTest did not work in the maven build. The test assumes that no git repository is found above the test project. When the junit-workspace was located inside a git repository this condition was not fulfilled. This is fixed using a MockSystemReader and a ceiling directory. Change-Id: I25913a2709512e25c211a31d431514561259bf80 Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui.test/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java8
2 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF b/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
index 49812e083b..a30ddce669 100644
--- a/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.ui.test/META-INF/MANIFEST.MF
@@ -13,7 +13,9 @@ Require-Bundle: org.apache.log4j;version="[1.0.0,2.0.0)",
org.eclipse.core.resources;version="[3.4.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
org.hamcrest;bundle-version="[1.1.0,2.0.0)"
-Import-Package: org.eclipse.jgit.lib;version="[0.8.0,0.9.0)",
+Import-Package: org.eclipse.jgit.junit;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.lib;version="[0.8.0,0.9.0)",
+ org.eclipse.jgit.util;version="[0.8.0,0.9.0)",
org.eclipse.swt.widgets,
org.eclipse.swtbot.eclipse.finder,
org.eclipse.swtbot.eclipse.finder.exceptions,
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
index 8158e688b8..e5b84d9176 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
@@ -20,7 +20,9 @@ import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.egit.ui.test.Eclipse;
+import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.util.SystemReader;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.After;
@@ -44,6 +46,12 @@ public class SharingWizardTest {
@BeforeClass
public static void beforeClass() throws Exception {
+ MockSystemReader mockSystemReader = new MockSystemReader();
+ SystemReader.setInstance(mockSystemReader);
+ mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,
+ ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile()
+ .getAbsoluteFile().toString());
+
if (bot.activeView().getTitle().equals("Welcome"))
bot.viewByTitle("Welcome").close();
bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate();

Back to the top