/**
* New method invocations should be added at the end of constructor.
*/
public void test_this_setProperty() throws Exception {
CompositeInfo composite =
parseJavaInfo(
"public class Test extends Composite {",
" public Test() {",
" {",
" Button button = new Button();",
" initWidget(button);",
" }",
" }",
"}");
composite.refresh();
// add setWidth()
composite.addMethodInvocation(
"setWidth(java.lang.String)",
StringConverter.INSTANCE.toJavaSource(null, "150px"));
assertEditor(
"public class Test extends Composite {",
" public Test() {",
" {",
" Button button = new Button();",
" initWidget(button);",
" }",
" setWidth('150px');",
" }",
"}");
// refresh
composite.refresh();
assertNoErrors(composite);
}