Search in sources :

Example 1 with ExmlComponentClassGenerator

use of net.jangaroo.exml.generator.ExmlComponentClassGenerator in project jangaroo-tools by CoreMedia.

the class ExmlComponentClassGeneratorTest method testGenerateClass.

@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());
}
Also used : StringWriter(java.io.StringWriter) ExmlModel(net.jangaroo.exml.model.ExmlModel) ExmlToModelParser(net.jangaroo.exml.parser.ExmlToModelParser) ExmlComponentClassGenerator(net.jangaroo.exml.generator.ExmlComponentClassGenerator) ExmlSourceFile(net.jangaroo.exml.model.ExmlSourceFile) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 StringWriter (java.io.StringWriter)1 ExmlComponentClassGenerator (net.jangaroo.exml.generator.ExmlComponentClassGenerator)1 ExmlModel (net.jangaroo.exml.model.ExmlModel)1 ExmlSourceFile (net.jangaroo.exml.model.ExmlSourceFile)1 ExmlToModelParser (net.jangaroo.exml.parser.ExmlToModelParser)1 Test (org.junit.Test)1