ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/AllElements.exml"));
Assert.assertEquals(new HashSet<String>(Arrays.asList("exmlparser.config.allElements", "ext.Panel", "ext.MessageBox")),
model.getImports());
Assert.assertEquals("ext.Panel", model.getSuperClassName());
JsonObject expectedJsonObject = new JsonObject(
"layout", "{config.myLayout}",
"title", "I am a panel",
"defaults", new JsonObject("layout","border"),
"layoutConfig", new JsonObject(
"bla", "blub",
"anchor", new JsonObject("style", "test"),
"border", new JsonObject("type", "solid")
),
"items", new JsonArray(
new JsonObject(
"xtype", "button",
"text", "Save"
),
"{{xtype: \"editortreepanel\"}}"
),
"menu", new JsonArray(
new JsonObject(
"xtype", "menuitem",
"text", "juhu1"
),
new JsonObject(
"xtype", "menuitem",
"text", "juhu2"
),
new JsonObject(
"xtype", "menuitem",
"text", "juhu3"
)
),
"tools", new JsonArray(
new JsonObject(
"handler", "{function(x){return ''+x;}}",
"id", "gear"
)
),
"plugins", new JsonArray(
new JsonObject(
"ptype", "aplugin"
),
new JsonObject(
"ptype", "aplugin"
)
),
"layout2", new JsonObject(
"type", "a"
)
);
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}