Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Weiser2017-05-15 19:08:51 +0000
committerDavid Weiser2017-05-17 11:42:43 +0000
commitb1ab6ef36de0f591ad9c861bffd7aa461f566a14 (patch)
treeed34e0430b8f791b082b426d6680eef593f29949 /org.eclipse.egit.ui.test/src/org/eclipse/egit
parent7686edafa09d77ff17a36c95ff5c1a7359653952 (diff)
downloadegit-b1ab6ef36de0f591ad9c861bffd7aa461f566a14.tar.gz
egit-b1ab6ef36de0f591ad9c861bffd7aa461f566a14.tar.xz
egit-b1ab6ef36de0f591ad9c861bffd7aa461f566a14.zip
Change discard local changes dialog OK-button label
Adds new String ("&Discard Changes") and uses it as OK-button label for the discard local changes dialog Changes creation of MessageDialog in DiscardChangesActionHandler. Fixes Tests. Bug: 514930 Change-Id: I4cbb0484517f013f272ef377c926a8b8fb3b22b5 Signed-off-by: David Weiser <david.weiser@vogella.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
index a362f9b3b2..2fc4876b6f 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/ReplaceActionsTest.java
@@ -59,7 +59,8 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
clickReplaceWith(menuLabel);
SWTBotShell confirm = bot
.shell(UIText.DiscardChangesAction_confirmActionTitle);
- executeReplace(confirm);
+ executeReplace(confirm,
+ UIText.DiscardChangesAction_discardChangesButtonText);
String replacedContent = getTestFileContent();
assertThat(replacedContent, not(initialContent));
}
@@ -102,7 +103,8 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
"ReplaceWithPreviousVersionAction.label");
clickReplaceWith(menuLabel);
bot.shell(UIText.DiscardChangesAction_confirmActionTitle).bot()
- .button(IDialogConstants.OK_LABEL).click();
+ .button(UIText.DiscardChangesAction_discardChangesButtonText)
+ .click();
SWTBotShell selectDialog = bot
.shell(UIText.CommitSelectDialog_WindowTitle);
assertEquals(2, selectDialog.bot().table().rowCount());
@@ -115,7 +117,8 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
clickReplaceWith(menuLabel);
bot.shell(UIText.DiscardChangesAction_confirmActionTitle).bot()
- .button(IDialogConstants.OK_LABEL).click();
+ .button(UIText.DiscardChangesAction_discardChangesButtonText)
+ .click();
TestUtil.waitForJobs(100, 5000);
selectDialog = bot.shell(UIText.CommitSelectDialog_WindowTitle);
@@ -123,7 +126,7 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
SWTBotTable table = selectDialog.bot().table();
assertEquals("Master commit", table.cell(0, 1));
table.select(0);
- executeReplace(selectDialog);
+ executeReplace(selectDialog, IDialogConstants.OK_LABEL);
TestUtil.waitForJobs(100, 5000);
String replacedContent = getTestFileContent();
@@ -137,10 +140,12 @@ public class ReplaceActionsTest extends LocalRepositoryTestCase {
menuLabel);
}
- private void executeReplace(SWTBotShell dialog) {
+ private void executeReplace(SWTBotShell dialog, String buttonLabel) {
JobJoiner jobJoiner = JobJoiner.startListening(
JobFamilies.DISCARD_CHANGES, 30, TimeUnit.SECONDS);
- dialog.bot().button(IDialogConstants.OK_LABEL).click();
+ dialog.bot()
+ .button(buttonLabel)
+ .click();
jobJoiner.join();
}
}

Back to the top