ScriptGenerator { static String createProcessedResourceName(String name, String executable) { if (name.startsWith("common-")) { return createProcessedResourceNameImpl(name, "common"); } else { return createProcessedResourceNameImpl(name, executable); } } ScriptGenerator(Step step, String executableName); VelocityContext getVelocityContext(); void addResource(Resource resource); boolean hasStepScript(); void writeScriptFiles(File cwd, boolean debug); void addScriptResources(Configuration conf, String parameterSuffix);  }
@Test public void testCreateProcessedResourceName() throws Exception { assertEquals("cmdline", ScriptGenerator.createProcessedResourceName("l2gen-cmdline.vm", "l2gen")); assertEquals("config.txt", ScriptGenerator.createProcessedResourceName("l2gen-config.txt.vm", "l2gen")); assertEquals("config.txt", ScriptGenerator.createProcessedResourceName("l2gen-config.txt", "l2gen")); assertEquals("should-process-cmdline", ScriptGenerator.createProcessedResourceName("l2gen-should-process-cmdline.vm", "l2gen")); assertEquals("should-process.py", ScriptGenerator.createProcessedResourceName("l2gen-should-process.py", "l2gen")); assertEquals("routines.py", ScriptGenerator.createProcessedResourceName("common-routines.py", "foo")); }