Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomasz Zarna2011-04-19 10:21:38 +0000
committerTomasz Zarna2011-04-19 10:21:38 +0000
commit52a7d23519cb1890b999fdd22c71581216fa34ef (patch)
tree4dc09a7cd9195fd1cffdf738d150e0bd7e6ec605 /tests
parent922f7c4be7c55a14d256a3578f3e830281e75a6e (diff)
downloadeclipse.platform.team-52a7d23519cb1890b999fdd22c71581216fa34ef.tar.gz
eclipse.platform.team-52a7d23519cb1890b999fdd22c71581216fa34ef.tar.xz
eclipse.platform.team-52a7d23519cb1890b999fdd22c71581216fa34ef.zip
bug 342541: [History View] New Branches column: column widths need some work - rename + additional test
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSHisoryTableProviderTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSHisoryTableProviderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSHisoryTableProviderTest.java
index 23b9681da..9391db539 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSHisoryTableProviderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/CVSHisoryTableProviderTest.java
@@ -176,6 +176,41 @@ public class CVSHisoryTableProviderTest extends EclipseTest {
}
}
+ public void testHiddenColumn() throws Exception {
+ Display display = Display.getCurrent();
+ Shell shell = new Shell(display);
+ Composite composite = new Composite(shell, SWT.NONE);
+ composite.setLayout(new FillLayout());
+
+ CVSHistoryTableProvider provider = new CVSHistoryTableProvider();
+ // provider.settings = createDialogSettings(...);
+ ReflectionUtils.setField(
+ provider,
+ "settings",
+ createDialogSettings(provider, new int[] { 100, 0, 100, 100,
+ 100, 100 }));
+ TreeViewer treeViewer = provider.createTree(composite);
+ Tree tree = treeViewer.getTree();
+ Layout layout = tree.getLayout();
+
+ // layout.getColumns(tree);
+ Item[] items = (Item[]) ReflectionUtils.callMethod(layout,
+ "getColumns", new Class[] { Composite.class },
+ new Object[] { tree });
+ assertEquals(6, items.length);
+
+ // List columns = layout.columns;
+ List/* <ColumnLayoutData> */columns = (List) ReflectionUtils.getField(
+ layout, "columns");
+ ColumnPixelData[] columnsArray = (ColumnPixelData[]) columns.toArray(new ColumnPixelData[0]);
+ assertEquals(100, columnsArray[0].width);
+ assertEquals(0, columnsArray[1].width); // keep user settings
+ assertEquals(100, columnsArray[2].width);
+ assertEquals(100, columnsArray[3].width);
+ assertEquals(100, columnsArray[4].width);
+ assertEquals(100, columnsArray[5].width);
+ }
+
private IDialogSettings createDialogSettings(
CVSHistoryTableProvider provider, int[] widths) {
String sectionName = (String) ReflectionUtils.getField(provider,

Back to the top