//
// Tests
//
////////////////////////////////////////////////////////////////////////////
public void test_parse() throws Exception {
CanvasInfo canvas =
parseJavaInfo(new String[]{
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" Canvas canvas = new Canvas();",
" Menu menu = new Menu();",
" MenuItem menuItem = new MenuItem('MenuItem');",
" menu.setItems(menuItem);",
" canvas.setContextMenu(menu);",
" canvas.draw();",
" }",
"}"});
canvas.refresh();
MenuInfo menu = canvas.getChildren(MenuInfo.class).get(0);
//
List<MenuItemInfo> items = menu.getItems();
assertThat(items.size()).isEqualTo(1);
MenuItemInfo item = items.get(0);
assertThat(item.getSubmenu()).isNull();