Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Lay2011-03-01 21:27:39 +0000
committerMatthias Sohn2011-03-01 21:27:39 +0000
commit5885d0ac6159a29abbf63475e19ccfc184b77d48 (patch)
tree262aaa2de74b2931c1c7e81e256a5d44ada3bef7 /org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history
parentbe36397a1808e581d5420ba31a09874a4a531475 (diff)
downloadegit-5885d0ac6159a29abbf63475e19ccfc184b77d48.tar.gz
egit-5885d0ac6159a29abbf63475e19ccfc184b77d48.tar.xz
egit-5885d0ac6159a29abbf63475e19ccfc184b77d48.zip
[historyView] Fix redraw bug with Show all Branches
Change-Id: If709597fa5726e230d591b474b07eeca03fd5bc3 Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java36
1 files changed, 34 insertions, 2 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 224452593..4ceed9b95 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
@@ -322,7 +322,28 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
final SWTBotTable table = getHistoryViewTable(PROJ1);
// check out the second line
- table.getTableItem(1).select();
+ final RevCommit[] commit = checkoutLine(table, 1);
+ assertEquals(commit[0].getId().name(), repo.getBranch());
+ }
+
+ @Test
+ public void testShowAllBranches() throws Exception {
+ toggleShowAllBranchesButton(true);
+ final SWTBotTable table = getHistoryViewTable(PROJ1);
+ int commits = getHistoryViewTable(PROJ1).rowCount();
+ checkoutLine(table, 1);
+
+ toggleShowAllBranchesButton(false);
+ assertEquals("Wrong number of commits", commits - 1,
+ getHistoryViewTable(PROJ1).rowCount());
+ toggleShowAllBranchesButton(true);
+ assertEquals("Wrong number of commits", commits,
+ getHistoryViewTable(PROJ1).rowCount());
+ }
+
+ private RevCommit[] checkoutLine(final SWTBotTable table, int line)
+ throws InterruptedException {
+ table.getTableItem(line).select();
final RevCommit[] commit = new RevCommit[1];
Display.getDefault().syncExec(new Runnable() {
@@ -337,7 +358,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
ContextMenuHelper.clickContextMenu(table,
UIText.GitHistoryPage_CheckoutMenuLabel);
TestUtil.joinJobs(JobFamilies.CHECKOUT);
- assertEquals(commit[0].getId().name(), repo.getBranch());
+ return commit;
}
/**
@@ -349,4 +370,15 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
private static void ensureTableItemLoaded(TableItem item) {
item.setText(item.getText()); // TODO: is there a better solution?
}
+
+ private void toggleShowAllBranchesButton(boolean checked) throws Exception{
+ getHistoryViewTable(PROJ1);
+ SWTBotView view = bot
+ .viewById("org.eclipse.team.ui.GenericHistoryView");
+ SWTBotToolbarToggleButton showAllBranches = (SWTBotToolbarToggleButton) view
+ .toolbarButton(UIText.GitHistoryPage_showAllBranches);
+ boolean isChecked = showAllBranches.isChecked();
+ if(isChecked && !checked || !isChecked && checked)
+ showAllBranches.click();
+ }
}

Back to the top