-
Bug
-
Resolution: Unresolved
-
P4
-
jfx12
Below are two test cases that I expect to pass:
Resizing parent
a) expected and actual: distribute the delta across children
b) expected: resize itself to the new width - actual: parent width unchanged
@Test
public void testResizeParentColumn() {
TableView table = new TableView();
TableColumn first = new TableColumn("First Name");
TableColumn last = new TableColumn("Last Name");
TableColumn parent = new TableColumn("Parent");
parent.getColumns().addAll(first, last);
table.getColumns().addAll(parent);
double initialWidth = 80;
assertEquals(initialWidth, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), .1);
assertEquals(first.getWidth() + last.getWidth(), parent.getWidth(), .1);
double delta = 100;
assertTrue(table.resizeColumn(parent, delta));
assertEquals(initialWidth + delta/2, first.getWidth(), .1);
assertEquals("parent width must be same as sum of childrens width",
first.getWidth() + last.getWidth(), parent.getWidth(), .1);
}
Resizing child:
a) expected and actual: resizes the child without touching siblings
b) expected: resize parent to new combined width - actual: parent width unchanged
@Test
public void testResizeChildColumn() {
TableView table = new TableView();
TableColumn first = new TableColumn("First Name");
TableColumn last = new TableColumn("Last Name");
TableColumn parent = new TableColumn("Parent");
parent.getColumns().addAll(first, last);
table.getColumns().addAll(parent);
double initialWidth = 80;
assertEquals(initialWidth, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), .1);
assertEquals(first.getWidth() + last.getWidth(), parent.getWidth(), .1);
double delta = 100;
assertTrue(table.resizeColumn(first, delta));
assertEquals(initialWidth + delta, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), 0.1);
assertEquals("parent width must be same as sum of childrens width",
first.getWidth() + last.getWidth(), parent.getWidth(), .1);
}
Resizing parent
a) expected and actual: distribute the delta across children
b) expected: resize itself to the new width - actual: parent width unchanged
@Test
public void testResizeParentColumn() {
TableView table = new TableView();
TableColumn first = new TableColumn("First Name");
TableColumn last = new TableColumn("Last Name");
TableColumn parent = new TableColumn("Parent");
parent.getColumns().addAll(first, last);
table.getColumns().addAll(parent);
double initialWidth = 80;
assertEquals(initialWidth, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), .1);
assertEquals(first.getWidth() + last.getWidth(), parent.getWidth(), .1);
double delta = 100;
assertTrue(table.resizeColumn(parent, delta));
assertEquals(initialWidth + delta/2, first.getWidth(), .1);
assertEquals("parent width must be same as sum of childrens width",
first.getWidth() + last.getWidth(), parent.getWidth(), .1);
}
Resizing child:
a) expected and actual: resizes the child without touching siblings
b) expected: resize parent to new combined width - actual: parent width unchanged
@Test
public void testResizeChildColumn() {
TableView table = new TableView();
TableColumn first = new TableColumn("First Name");
TableColumn last = new TableColumn("Last Name");
TableColumn parent = new TableColumn("Parent");
parent.getColumns().addAll(first, last);
table.getColumns().addAll(parent);
double initialWidth = 80;
assertEquals(initialWidth, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), .1);
assertEquals(first.getWidth() + last.getWidth(), parent.getWidth(), .1);
double delta = 100;
assertTrue(table.resizeColumn(first, delta));
assertEquals(initialWidth + delta, first.getWidth(), .1);
assertEquals(initialWidth, last.getWidth(), 0.1);
assertEquals("parent width must be same as sum of childrens width",
first.getWidth() + last.getWidth(), parent.getWidth(), .1);
}