diff options
| author | Jens Baumgart | 2010-09-23 12:10:37 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2010-09-24 12:25:37 +0000 |
| commit | b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86 (patch) | |
| tree | 2aa181ed05ca92d4a71023d5a4ca8b70cef76dfe | |
| parent | 1fc344e151da9716823bd5dd977a6a4d8782a69d (diff) | |
| download | egit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.tar.gz egit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.tar.xz egit-b9e8e1bae984120a6c2fbc1ed95e4a74f8cfef86.zip | |
Fix HistoryViewTest problem with virtual tables
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.java | 21 |
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 3be86945c0..7ef62d324f 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? + } } |
