Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test/src')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java24
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java3
2 files changed, 14 insertions, 13 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java
index ad3511410d..5f604e1c38 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java
@@ -57,24 +57,26 @@ public class PushToUpstreamTest extends LocalRepositoryTestCase {
public void pushWithExistingUpstreamConfiguration() throws Exception {
checkoutNewLocalBranch("bar");
// Existing configuration
+ String remoteName = "fetch";
repository.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION,
- "bar", ConfigConstants.CONFIG_KEY_REMOTE, "fetch");
+ "bar", ConfigConstants.CONFIG_KEY_REMOTE, remoteName);
repository.getConfig().setString(ConfigConstants.CONFIG_BRANCH_SECTION,
"bar", ConfigConstants.CONFIG_KEY_MERGE, "refs/heads/bar");
- pushToUpstream();
+ pushToUpstream(remoteName);
assertBranchPushed("bar", remoteRepository);
}
@Test
public void pushWithDefaultRemoteWithPushRefSpecs() throws Exception {
checkoutNewLocalBranch("baz");
- repository.getConfig().setString("remote", "origin", "pushurl",
+ String remoteName = "origin";
+ repository.getConfig().setString("remote", remoteName, "pushurl",
repository.getConfig().getString("remote", "push", "pushurl"));
- repository.getConfig().setString("remote", "origin", "push",
+ repository.getConfig().setString("remote", remoteName, "push",
"refs/heads/*:refs/heads/*");
- pushToUpstream();
+ pushToUpstream(remoteName);
assertBranchPushed("baz", remoteRepository);
}
@@ -105,12 +107,13 @@ public class PushToUpstreamTest extends LocalRepositoryTestCase {
return projectExplorerTree;
}
- private void pushToUpstream() {
+ private void pushToUpstream(String remoteName) {
SWTBotTree project = selectProject();
JobJoiner joiner = JobJoiner.startListening(JobFamilies.PUSH, 20,
TimeUnit.SECONDS);
ContextMenuHelper
- .clickContextMenu(project, getPushToUpstreamMenuPath());
+ .clickContextMenu(project,
+ getPushToUpstreamMenuPath(remoteName));
TestUtil.openJobResultDialog(joiner.join());
SWTBotShell resultDialog = TestUtil
.botForShellStartingWith("Push Results");
@@ -120,12 +123,11 @@ public class PushToUpstreamTest extends LocalRepositoryTestCase {
private void assertPushToUpstreamDisabled() {
SWTBotTree project = selectProject();
boolean enabled = ContextMenuHelper.isContextMenuItemEnabled(project,
- getPushToUpstreamMenuPath());
+ getPushToUpstreamMenuPath("Upstream"));
assertFalse("Expected Push to Upstream to be disabled", enabled);
}
- private String[] getPushToUpstreamMenuPath() {
- return new String[] { "Team",
- util.getPluginLocalizedValue("PushToUpstreamCommand.label") };
+ private String[] getPushToUpstreamMenuPath(String remoteName) {
+ return new String[] { "Team", "Push to " + remoteName };
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
index b74ebb3656..e5ee3cf1cb 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/FetchAndMergeActionTest.java
@@ -160,8 +160,7 @@ public class FetchAndMergeActionTest extends LocalRepositoryTestCase {
private void fetch() throws Exception {
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
- String menuString = util
- .getPluginLocalizedValue("FetchFromUpstreamAction.label");
+ String menuString = "Fetch from origin";
JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 20, TimeUnit.SECONDS);
ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
menuString);

Back to the top