"ID : 'a';\n");
Tool antlr = newTool();
antlr.setOutputDirectory(null); // write to /dev/null
CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
ActionTranslator translator =
new ActionTranslator(generator,
"a",
new antlr.CommonToken(ANTLRParser.ACTION,action),1);
g.setCodeGenerator(generator);
generator.genRecognizer(); // forces load of templates
String rawTranslation =
translator.translate();
StringTemplateGroup templates =
new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
StringTemplate actionST = new StringTemplate(templates, rawTranslation);
String found = actionST.toString();
assertEquals(expecting, found);