////////////////////////////////////////////////////////////////////////////
/**
* Test for parsing @UiChild annotations into {@link Position}s.
*/
public void test_positions() throws Exception {
WidgetInfo container =
parse(
"// filler filler filler filler filler",
"// filler filler filler filler filler",
"<ui:UiBinder>",
" <t:MyContainer>",
" <t:topbutton>",
" <g:Button wbp:name='button_1' text='1'/>",
" </t:topbutton>",
" <t:topbutton text='B'>",
" <g:Button wbp:name='button_2' text='2'/>",
" </t:topbutton>",
" <t:bottomWidget>",
" <g:TextBox wbp:name='textBox'/>",
" </t:bottomWidget>",
" </t:MyContainer>",
"</ui:UiBinder>");
assertHierarchy(
"// filler filler filler filler filler",
"// filler filler filler filler filler",
"<t:MyContainer>",
" <g:Button wbp:name='button_1' text='1'>",
" <g:Button wbp:name='button_2' text='2'>",
" <g:TextBox wbp:name='textBox'>");
refresh();
WidgetInfo button_1 = getObjectByName("button_1");
WidgetInfo button_2 = getObjectByName("button_2");
WidgetInfo textBox = getObjectByName("textBox");
// check Button's text
assertEquals("1", ReflectionUtils.invokeMethod(button_1.getObject(), "getText()"));
assertEquals("B", ReflectionUtils.invokeMethod(button_2.getObject(), "getText()"));
// "container" children are Position-s
List<ObjectInfo> containerChildren = container.getPresentation().getChildrenTree();