aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2011-05-14 11:21:18 (EDT)
committerDariusz Luksza2011-05-14 11:21:18 (EDT)
commite5913363268a73685a1570e1f085ce889815a667 (patch)
treeabcca5a1bec960aef6467156b26f8033689e22a5
parentf530556c54ae2f118782b39fa287972f0c4f9870 (diff)
downloadegit-e5913363268a73685a1570e1f085ce889815a667.zip
egit-e5913363268a73685a1570e1f085ce889815a667.tar.gz
egit-e5913363268a73685a1570e1f085ce889815a667.tar.bz2
Fix unstable test in SynchronizeViewGitChangeSetModelTestrefs/changes/17/3417/2
shouldExchangeCompareEditorSidesBetweenIncomingAndOutgoingChanges was failing sporadically. The problem was that SWTBot found the same StyledText using styledText(0) and styledText(1). When getting the compare editor, we now focus it to make sure that it's enabled. This results in the right StyledTexts to be returned. Change-Id: I5185532160b28cfbd04ece5eeec48cf9f5ccefb0 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
index 656f390..5a919c1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
@@ -251,7 +251,10 @@ public abstract class AbstractSynchronizeViewTest extends
SWTBotTreeItem folderNode = waitForNodeWithText(projNode, FOLDER);
waitForNodeWithText(folderNode, fileName).doubleClick();
- return bot.editorByTitle(fileName);
+ SWTBotEditor editor = bot.editorByTitle(fileName);
+ // Ensure that both StyledText widgets are enabled
+ editor.toTextEditor().setFocus();
+ return editor;
}
protected SWTBotTreeItem waitForNodeWithText(SWTBotTree tree, String name) {
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
index 6f810c4..e3a4474 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java
@@ -195,6 +195,8 @@ public class SynchronizeViewGitChangeSetModelTest extends
String outgoingRight = outgoingCompareBot.styledText(1).getText();
outgoingCompare.close();
+ assertNotSame("Text from SWTBot widgets was the same", outgoingLeft, outgoingRight);
+
// when
// compare tag against HEAD
launchSynchronization(SynchronizeWithAction_tagsName, INITIAL_TAG,