@Test public void testGenerate() throws Exception { final CascadingFieldsGenerator gen = new CascadingFieldsGenerator(); final Schema schema = getSchema(); final Writer writer = new StringWriter(); gen.generate(schema, writer); writer.close(); final String actual = writer.toString(); final String expected = Resources.toString(getClass().getResource("expected.txt"), Charsets.UTF_8); assertEquals(expected, actual); }
public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output); }
CascadingFieldsGenerator { public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output); } }
CascadingFieldsGenerator { public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output); } CascadingFieldsGenerator(); }
CascadingFieldsGenerator { public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output); } CascadingFieldsGenerator(); void generate(Schema schema, Writer output); String fieldsClassName(String name); File getDestination(Schema schema, File outputDirectory); }
CascadingFieldsGenerator { public void generate(Schema schema, Writer output) throws IOException { final VelocityContext context = new VelocityContext(); context.put("schema", schema); context.put("this", this); engine.mergeTemplate(path + "fields.vm", "UTF-8", context, output); } CascadingFieldsGenerator(); void generate(Schema schema, Writer output); String fieldsClassName(String name); File getDestination(Schema schema, File outputDirectory);  }