< prev index next >

functional/ControlsTests/test/javafx/scene/control/test/tableview/TableViewTest.java

Print this page




 126         }
 127         testedControl.waitState(vScrollBarCount, Integer.valueOf(0));
 128 
 129         testedControl.waitState(hScrollBarCount, Integer.valueOf(1));
 130         for (int i = 0; i < COLS_TO_REMOVE; i++) {
 131             btnRemoveColumn.mouse().click();
 132         }
 133         testedControl.waitState(hScrollBarCount, Integer.valueOf(0));
 134 
 135         btnInsertItem.mouse().click();
 136         testedControl.waitState(vScrollBarCount, Integer.valueOf(1));
 137 
 138         btnInsertColumn.mouse().click();
 139         testedControl.waitState(hScrollBarCount, Integer.valueOf(1));
 140     }
 141 
 142     /**
 143      * Checks that sort works for the column. According to the spec there are
 144      * three states of sorting and all of them are checked
 145      *
 146      * http://xdesign.us.oracle.com/projects/javaFX/fxcontrols-ue/specifications/treetable/treetable.html#sorting
 147      */
 148     @Smoke
 149     @Test(timeout = 300000)
 150     public void columnSortTest() throws Throwable {
 151         Wrap<? extends Node> columHeader = headerWrap.as(Parent.class, Node.class).lookup(Label.class, new ByText("field 0")).wrap();
 152 
 153         //Ascending sort
 154         columHeader.mouse().click();
 155         Wrap<? extends IndexedCell> cellWrap = getCellWrap(0, isTableTests ? 0 : 1);// first line for treeTable - is root line.
 156         assertTrue(cellWrap.getControl().getItem().equals("item 00 field 0"));
 157 
 158         //Descending sort
 159         columHeader.mouse().click();
 160         cellWrap = getCellWrap(0, isTableTests ? 0 : 1);
 161         int expectedIndex = isTableTests
 162                              ? TableViewApp.DATA_ITEMS_NUM - 1
 163                              : TreeTableAsOldTableApp.DATA_ITEMS_NUM - 2;
 164         assertEquals(String.format("item %02d field 0", expectedIndex), cellWrap.getControl().getItem());
 165 
 166         //Disable sort




 126         }
 127         testedControl.waitState(vScrollBarCount, Integer.valueOf(0));
 128 
 129         testedControl.waitState(hScrollBarCount, Integer.valueOf(1));
 130         for (int i = 0; i < COLS_TO_REMOVE; i++) {
 131             btnRemoveColumn.mouse().click();
 132         }
 133         testedControl.waitState(hScrollBarCount, Integer.valueOf(0));
 134 
 135         btnInsertItem.mouse().click();
 136         testedControl.waitState(vScrollBarCount, Integer.valueOf(1));
 137 
 138         btnInsertColumn.mouse().click();
 139         testedControl.waitState(hScrollBarCount, Integer.valueOf(1));
 140     }
 141 
 142     /**
 143      * Checks that sort works for the column. According to the spec there are
 144      * three states of sorting and all of them are checked
 145      *

 146      */
 147     @Smoke
 148     @Test(timeout = 300000)
 149     public void columnSortTest() throws Throwable {
 150         Wrap<? extends Node> columHeader = headerWrap.as(Parent.class, Node.class).lookup(Label.class, new ByText("field 0")).wrap();
 151 
 152         //Ascending sort
 153         columHeader.mouse().click();
 154         Wrap<? extends IndexedCell> cellWrap = getCellWrap(0, isTableTests ? 0 : 1);// first line for treeTable - is root line.
 155         assertTrue(cellWrap.getControl().getItem().equals("item 00 field 0"));
 156 
 157         //Descending sort
 158         columHeader.mouse().click();
 159         cellWrap = getCellWrap(0, isTableTests ? 0 : 1);
 160         int expectedIndex = isTableTests
 161                              ? TableViewApp.DATA_ITEMS_NUM - 1
 162                              : TreeTableAsOldTableApp.DATA_ITEMS_NUM - 2;
 163         assertEquals(String.format("item %02d field 0", expectedIndex), cellWrap.getControl().getItem());
 164 
 165         //Disable sort


< prev index next >