Package net.jangaroo.exml.parser

Examples of net.jangaroo.exml.parser.ExmlToModelParser


  }

  @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",
View Full Code Here


  }

  @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(
View Full Code Here

  }

  @Test
  public void testBaseClass() throws Exception {
    setUp("exmlparser.config");
    ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestBaseClassUnqualified.exml"));
    Assert.assertEquals("BaseClass", model.getSuperClassName());

    model = exmlToModelParser.parse(getFile("/exmlparser/TestBaseClass.exml"));
    Assert.assertEquals("someOtherPackage.base.BaseClass", model.getSuperClassName());
  }
View Full Code Here

  }

  @Test
  public void testConstants() throws Exception {
    setUp("exmlparser.config");
    ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());

    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/TestConstants.exml"));
    Declaration aConstant = model.getConfigClass().getConstants().get(0);
    Assert.assertEquals("A_CONSTANT", aConstant.getName());
    Assert.assertEquals("\"One two three\"", aConstant.getValue());
    Assert.assertEquals("String", aConstant.getType());
    Assert.assertEquals("This is some constant", aConstant.getDescription());
View Full Code Here

  @Test
  public void testGenerateClass() throws Exception {
    setUp("exmlparser.config");
    String expected = FileUtils.readFileToString(new File(getClass().getResource("/expected/AllElements.as").toURI()));

    ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
    ExmlModel model = exmlToModelParser.parse(getFile("/exmlparser/AllElements.exml"));

    StringWriter output = new StringWriter();
    new ExmlComponentClassGenerator(getExmlc().getConfig()).generateClass(model, output);
    Assert.assertEquals(expected, output.toString());
  }
View Full Code Here

  @Test
  public void testGenerateClassWithLowerCaseFileName() throws Exception {
    setUp("exmlparser.config");
    File sourceFile = getFile("/exmlparser/testLowerCase.exml");

    ExmlToModelParser exmlToModelParser = new ExmlToModelParser(getConfigClassRegistry());
    ExmlModel model = exmlToModelParser.parse(sourceFile);

    Assert.assertEquals("TestLowerCase", model.getClassName());
    Assert.assertEquals("testLowerCase", model.getConfigClass().getName());
    Assert.assertEquals("exmlparser", model.getPackageName());
  }
View Full Code Here

  @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());
  }
View Full Code Here

TOP

Related Classes of net.jangaroo.exml.parser.ExmlToModelParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.