// "container" children are Position-s
List<ObjectInfo> containerChildren = container.getPresentation().getChildrenTree();
assertThat(containerChildren).hasSize(2);
// "bottom" position
{
Position position = (Position) containerChildren.get(0);
assertEquals(
"com.google.gwt.user.client.ui.Widget",
position.getWidgetClass().getCanonicalName());
// presentation
IObjectPresentation presentation = position.getPresentation();
assertEquals("bottomWidget", presentation.getText());
assertNotNull(presentation.getIcon());
// tree children
List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
assertThat(positionChildren).containsExactly(textBox);
}
// "top" position
{
Position position = (Position) containerChildren.get(1);
assertEquals(
"com.google.gwt.user.client.ui.Button",
position.getWidgetClass().getCanonicalName());
// presentation
IObjectPresentation presentation = position.getPresentation();
assertEquals("topbutton", presentation.getText());
assertNotNull(presentation.getIcon());
// tree children
List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
assertThat(positionChildren).containsExactly(button_1, button_2);
}
}