Search in sources :

Example 6 with GeneratorNodeProcessor

use of org.eclipse.xtext.generator.trace.node.GeneratorNodeProcessor in project xtext-core by eclipse.

the class TemplateNodeTest method assertEquals.

protected void assertEquals(final StringConcatenationClient c) {
    final GeneratorNodeExtensions ext = new GeneratorNodeExtensions();
    final GeneratorNodeProcessor processor = new GeneratorNodeProcessor();
    final CompositeGeneratorNode root = new CompositeGeneratorNode();
    ext.appendTemplate(root, c);
    final GeneratorNodeProcessor.Result result = processor.process(root);
    final StringConcatenation expected = new StringConcatenation();
    expected.append(c);
    final String expectedM = expected.toString().replaceAll(System.lineSeparator(), "\n");
    final String resultM = result.toString().replaceAll(System.lineSeparator(), "\n");
    Assert.assertEquals(expectedM, resultM);
}
Also used : GeneratorNodeProcessor(org.eclipse.xtext.generator.trace.node.GeneratorNodeProcessor) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) CompositeGeneratorNode(org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode) GeneratorNodeExtensions(org.eclipse.xtext.generator.trace.node.GeneratorNodeExtensions)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)6 CompositeGeneratorNode (org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode)6 GeneratorNodeProcessor (org.eclipse.xtext.generator.trace.node.GeneratorNodeProcessor)6 Test (org.junit.Test)5 LocationData (org.eclipse.xtext.generator.trace.LocationData)3 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)2 GeneratorNodeExtensions (org.eclipse.xtext.generator.trace.node.GeneratorNodeExtensions)1 IndentNode (org.eclipse.xtext.generator.trace.node.IndentNode)1