ExmlModel model = exmlToModelParser.parse(getFile("/testPackage/TestComponentWithCfgDefaults.exml"));
List<ConfigAttribute> cfgs = model.getConfigClass().getDirectCfgs();
Assert.assertEquals(5, cfgs.size());
JsonObject expectedJsonObject = new JsonObject(
"propertyWithLiteralDefault", "foobar",
"propertyWithExpressionDefault", "{'foo' + 'bar'}",
"propertyWithDefaultElement",
new JsonObject(
"xtype", "button",
"text", "click me!"
),
"propertyWithDefaultElementUsingConfig",
new JsonObject(
"xtype", "button",
"text", "{config.title + '!'}"
),
"arrayPropertyWithDefaultElement",
new JsonArray(
new JsonObject(
"xtype", "button",
"text", "button1"
),
new JsonObject(
"xtype", "button",
"text", "button2"
)
),
"title", "{config.defaultTitle}"
);
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}