-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 8u60
-
Component/s: javafx
-
Environment:
8u60b5, win7
selectedIndex (and all selectedIndices, didn't check these, though) must be increased/decreased by 1 on showing/hiding the root, but doesn't.
Failing test snippets
@Test
public void testShowRootItemAtIndexOn() {
assertFalse("sanity: test setup such that root is not showing", getView().isShowRoot());
int index = 3;
getSelectionModel().select(index);
assertEquals(getSelectedItem(), getView().getTreeItem(getSelectedIndex()));
getView().setShowRoot(true);
assertEquals(getSelectedItem(), getView().getTreeItem(getSelectedIndex()));
}
@Test
public void testShowRootIndexOn() {
assertFalse("sanity: test setup such that root is not showing", getView().isShowRoot());
int index = 3;
getSelectionModel().select(index);
getView().setShowRoot(true);
assertEquals(index + 1, getSelectedIndex());
}
Failing test snippets
@Test
public void testShowRootItemAtIndexOn() {
assertFalse("sanity: test setup such that root is not showing", getView().isShowRoot());
int index = 3;
getSelectionModel().select(index);
assertEquals(getSelectedItem(), getView().getTreeItem(getSelectedIndex()));
getView().setShowRoot(true);
assertEquals(getSelectedItem(), getView().getTreeItem(getSelectedIndex()));
}
@Test
public void testShowRootIndexOn() {
assertFalse("sanity: test setup such that root is not showing", getView().isShowRoot());
int index = 3;
getSelectionModel().select(index);
getView().setShowRoot(true);
assertEquals(index + 1, getSelectedIndex());
}