summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJens Baumgart2010-09-23 08:10:37 (EDT)
committer Matthias Sohn2010-09-24 08:25:37 (EDT)
commitb9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86 (patch)
tree2aa181ed05ca92d4a71023d5a4ca8b70cef76dfe
parent1fc344e151da9716823bd5dd977a6a4d8782a69d (diff)
downloadegit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.zip
egit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.tar.gz
egit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.tar.bz2
Fix HistoryViewTest problem with virtual tablesrefs/changes/54/1654/3
HistoryViewTest failed on Linux because a selected table item of the virtual history view table was not loaded. Table items of a virtual table are only loaded if the item is visible. The fix forces loading the selected table item. Change-Id: If24731c3c0544ff9c3cda368dd8f95d48f6f43dd Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
index 3be8694..7ef62d3 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -30,6 +30,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotPerspective;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
@@ -284,8 +285,9 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
Display.getDefault().syncExec(new Runnable() {
public void run() {
- commit[0] = (RevCommit) table.widget.getSelection()[0]
- .getData();
+ TableItem tableItem = table.widget.getSelection()[0];
+ ensureTableItemLoaded(tableItem);
+ commit[0] = (RevCommit) tableItem.getData();
}
});
@@ -314,8 +316,9 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
Display.getDefault().syncExec(new Runnable() {
public void run() {
- commit[0] = (RevCommit) table.widget.getSelection()[0]
- .getData();
+ TableItem tableItem = table.widget.getSelection()[0];
+ ensureTableItemLoaded(tableItem);
+ commit[0] = (RevCommit) tableItem.getData();
}
});
@@ -325,4 +328,14 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
waitInUI();
assertEquals(commit[0].getId().name(), repo.getBranch());
}
+
+ /**
+ * Workaround to ensure that the TableItem of a SWT table with style
+ * SWT_VIRTUAL is loaded.
+ *
+ * @param item
+ */
+ private static void ensureTableItemLoaded(TableItem item) {
+ item.setText(item.getText()); // TODO: is there a better solution?
+ }
}