assertHierarchy(
"{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(bar)/}",
" {new: com.google.gwt.user.client.ui.MenuBar} {local-unique: bar} {/new MenuBar()/ /rootPanel.add(bar)/ /bar.addSeparator(separator)/}",
" {new: com.google.gwt.user.client.ui.MenuItemSeparator} {local-unique: separator} {/new MenuItemSeparator()/ /bar.addSeparator(separator)/}");
MenuBarInfo bar = getJavaInfoByName("bar");
MenuItemSeparatorInfo separator = (MenuItemSeparatorInfo) bar.getAllItems().get(0);
// association
assertInstanceOf(InvocationChildAssociation.class, separator.getAssociation());
// only item in "bar"
assertThat(bar.getAllItems()).containsOnly(separator);
// IMenuItemInfo
{
IMenuItemInfo separatorObject;
{
IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
List<IMenuItemInfo> items = barObject.getItems();
assertThat(items).hasSize(1);
separatorObject = items.get(0);
}
// ask IMenuItemInfo directly
assertNull(separator.getAdapter(List.class));
assertSame(separatorObject, MenuObjectInfoUtils.getMenuItemInfo(separator));
// model
assertSame(separator, separatorObject.getModel());
assertSame(separator, separatorObject.getToolkitModel());
// presentation