use of net.jangaroo.exml.model.ExmlModel in project jangaroo-tools by CoreMedia.
the class ExmlComponentClassGeneratorTest method testGenerateClassWithUpperCaseFileName.
@Test
public void testGenerateClassWithUpperCaseFileName() throws Exception {
setUp("exmlparser.config");
File sourceFile = getFile("/exmlparser/AllElements.exml");
ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
ExmlModel model = exmlToModelParser.parse(sourceFile);
Assert.assertEquals("AllElements", model.getClassName());
Assert.assertEquals("allElements", model.getConfigClass().getName());
Assert.assertEquals("exmlparser", model.getPackageName());
}
use of net.jangaroo.exml.model.ExmlModel in project jangaroo-tools by CoreMedia.
the class ExmlToModelParserTest method testInheritProperties.
@Test
public void testInheritProperties() throws Exception {
setUp("testNamespace.config");
ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
ExmlModel model = exmlToModelParser.parse(getFile("/testPackage/TestComponent2.exml"));
Assert.assertEquals("testPackage.TestComponent", model.getSuperClassName());
JsonObject expectedJsonObject = new JsonObject("items", new JsonArray(new JsonObject("propertyThree", "3").settingWrapperClass("testNamespace.config.testComponent2")), "columns", new JsonObject("xtype", "agridcolumn"));
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}
use of net.jangaroo.exml.model.ExmlModel in project jangaroo-tools by CoreMedia.
the class ExmlToModelParserTest method testContainerDefaults.
@Test
public void testContainerDefaults() throws Exception {
setUp("testNamespace.config");
ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
ExmlModel model = exmlToModelParser.parse(getFile("/testPackage/TestContainerDefaults.exml"));
JsonObject expectedJsonObject = new JsonObject("defaults", new JsonObject("text", "it works!"), "defaultType", "button", "items", new JsonArray(new JsonObject("xtype", "container", "defaults", new JsonObject("propertyOne", true), "defaultType", "testNamespace.config.testComponent")));
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}
use of net.jangaroo.exml.model.ExmlModel in project jangaroo-tools by CoreMedia.
the class ExmlToModelParserTest method testParseActions.
@Test
public void testParseActions() throws Exception {
setUp("exmlparser.config");
ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestActions.exml"));
Assert.assertEquals("ext.Panel", model.getSuperClassName());
JsonObject expectedJsonObject = new JsonObject("baseAction", JsonObject.code("net.jangaroo.ext.create(ext.config.action,{disabled: false})"));
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}
use of net.jangaroo.exml.model.ExmlModel in project jangaroo-tools by CoreMedia.
the class ExmlToModelParserTest method testParseTyped.
@Test
public void testParseTyped() throws Exception {
setUp("exmlparser.config");
ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestTyped.exml"));
Assert.assertEquals("ext.Panel", model.getSuperClassName());
JsonObject expectedJsonObject = new JsonObject("items", new JsonArray(new JsonObject("xtype", "component", // not the number 5!
"margins", // not the number 5!
"5"), new JsonObject("xtype", "component", // not the boolean false!
"id", // not the boolean false!
"false")));
System.out.println(model.getJsonObject().toString(2));
Assert.assertEquals(expectedJsonObject.toString(2), model.getJsonObject().toString(2));
}
Aggregations