CascadingFieldsGenerator { public File getDestination(Schema schema, File outputDirectory) { final String classFile = fieldsClassName(schema.getName()) + ".java"; final String packageDir; if(schema.getNamespace() == null) { packageDir = ""; } else { packageDir = schema.getNamespace().replace('.', '/'); } return new File(new File(outputDirectory, packageDir), classFile); } CascadingFieldsGenerator(); void generate(Schema schema, Writer output); String fieldsClassName(String name); File getDestination(Schema schema, File outputDirectory);  }
@Test public void testDestFile() throws Exception { final CascadingFieldsGenerator gen = new CascadingFieldsGenerator(); final Schema schema = getSchema(); final File actual = gen.getDestination(schema, new File("/tmp")); assertEquals(new File("/tmp/com/maxpoint/cascading/avro/Test1Fields.java"), actual); }