Bug handling FlexTable rows containing widgets with children

15 views
Skip to first unread message

dick.w...@sas.com

unread,
Oct 7, 2014, 10:09:52 AM10/7/14
to gwt-test-u...@googlegroups.com
There appears to be a bug in gwt-test-utils in handling FlexTable cells that contain widgets that have children (such as panels).

I'm using GWT 2.6.0 and gwt-test-utils 0.47.

Here is the code extract:

  FlexTable testFlexTable = new FlexTable();
  HorizontalPanel panel = new HorizontalPanel();
  panel.add(new Label("Label Text"));
  ListBox testStatusListBox = new ListBox( );
  panel.add(testStatusListBox);

  testFlexTable.setWidget(0, 0, panel);
  int count = testFlexTable.getCellCount( 1 );
  System.out.println("FlexBug/createFlexTable:  count is "+count);
  
  testFlexTable.setText(0,1, "Test simple cell");


When this code is run normally, it works fine.  The call to getCellCount returns 1 as expected.

When invoked by a unit test using gwt-test-utils, the code fails.  The call to getCellCount returns 3 instead of 1.  It looks like the gwt-test-utils implementation of FlexTable is recursively counting the children of a widget in a cell as cells.  If I change the number of children the panel in the cell has, the count changes.

Because of this bug, the call to setText fails with a null pointer exception.  That call uses getCellCount to determine how many cells already exist in the row and then assumes (since the return value is 3) that the cell already exists.


Reply all
Reply to author
Forward
0 new messages