Search in sources :

Example 11 with JsonArray

use of net.jangaroo.exml.json.JsonArray in project jangaroo-tools by CoreMedia.

the class ExmlToModelParserTest method testConfigModes.

@Test
public void testConfigModes() throws Exception {
    setUp("testNamespace.config");
    ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
    ExmlModel model = exmlToModelParser.parse(getFile("/testPackage/TestComponentWithConfigModes.exml"));
    Assert.assertEquals("testPackage.TestComponent", model.getSuperClassName());
    JsonObject expectedJsonObject = new JsonObject("items", new JsonArray(new JsonObject("propertyThree", "3").settingWrapperClass("testNamespace.config.testComponent2")), "items$at", JsonObject.code("net.jangaroo.ext.Exml.APPEND"), "propertyFive", new JsonArray(new JsonObject("xtype", "agridcolumn")), "propertyFive$at", JsonObject.code("net.jangaroo.ext.Exml.PREPEND"), "layoutConfig", new JsonObject("mode", "foo"));
    System.out.println(model.getJsonObject().toString(2));
    Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}
Also used : JsonArray(net.jangaroo.exml.json.JsonArray) ExmlModel(net.jangaroo.exml.model.ExmlModel) JsonObject(net.jangaroo.exml.json.JsonObject) ExmlToModelParser(net.jangaroo.exml.parser.ExmlToModelParser) Test(org.junit.Test)

Aggregations

JsonArray (net.jangaroo.exml.json.JsonArray)11 JsonObject (net.jangaroo.exml.json.JsonObject)11 ExmlModel (net.jangaroo.exml.model.ExmlModel)10 ExmlToModelParser (net.jangaroo.exml.parser.ExmlToModelParser)10 Test (org.junit.Test)10 ConfigAttribute (net.jangaroo.exml.model.ConfigAttribute)1 Declaration (net.jangaroo.exml.model.Declaration)1