Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2012-01-25 22:51:13 +0000
committerMatthias Sohn2012-01-25 22:51:13 +0000
commitdff0f1a7317d8e29479bd430f21fde5cd2a56917 (patch)
tree8d96b9c89bf4fcc5020b1f44f0930dc0c9ef1688
parent1221a8cac0c16fa63a1c693829df66f68f0bc853 (diff)
downloadegit-dff0f1a7317d8e29479bd430f21fde5cd2a56917.tar.gz
egit-dff0f1a7317d8e29479bd430f21fde5cd2a56917.tar.xz
egit-dff0f1a7317d8e29479bd430f21fde5cd2a56917.zip
Fix GitCloneWizartTest.invalidPortFreezesDialog
Screenshot taken by SWTBot after failing test cases doesn't show clone wizard page. Before we didn't check if it does appear, this change ensures that it is shown. Change-Id: I44a88f51b8ad1d3f7b1f2926c28039af7483966e Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java4
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/TestUtil.java15
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java7
3 files changed, 23 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
index 2bfdca6ef0..cc68338c0b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/GitImportRepoWizard.java
@@ -12,6 +12,8 @@ package org.eclipse.egit.ui.common;
import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
+import org.eclipse.egit.ui.UIText;
+import org.eclipse.egit.ui.test.TestUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -40,6 +42,8 @@ public class GitImportRepoWizard {
bot.shell("Clone Git Repository").activate();
+ TestUtil.waitUntilViewWithGivenTitleShows(UIText.GitCloneWizard_title);
+
return new RepoPropertiesPage();
}
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 845f1e3505..28e59041dc 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
@@ -487,4 +487,19 @@ public class TestUtil {
});
}
+ public static void waitUntilViewWithGivenTitleShows(final String viewTitle) {
+ waitForView(new BaseMatcher<IViewReference>() {
+ public boolean matches(Object item) {
+ if (item instanceof IViewReference)
+ return viewTitle.equals(((IViewReference) item).getTitle());
+
+ return false;
+ }
+
+ public void describeTo(Description description) {
+ description.appendText("Wait for view with title " + viewTitle);
+ }
+ });
+ }
+
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
index d8229f5e1d..8fc9234566 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
@@ -256,9 +256,10 @@ public class GitCloneWizardTest extends GitCloneWizardTestBase {
RepoPropertiesPage repoProperties = importWizard.openCloneWizard();
RepoRemoteBranchesPage remoteBranches = repoProperties
.nextToRemoteBranches("git://localhost:80/EGIT");
- remoteBranches
- .assertErrorMessage("Exception caught during execution of ls-remote command:\n"
- + "git://localhost:80/EGIT: Connection refused");
+ remoteBranches.assertErrorMessage(NLS.bind(
+ UIText.SourceBranchPage_CompositeTransportErrorMessage,
+ "Exception caught during execution of ls-remote command",
+ "git://localhost:80/EGIT: Connection refused"));
remoteBranches.assertCannotProceed();
remoteBranches.cancel();
}

Back to the top