test_class.file: dbdeploy-core/src/test/java/com/dbdeploy/appliers/TemplateBasedApplierTest.java
test_class.identifier: TemplateBasedApplierTest
test_case.body: @Test
  	public void shouldThrowUsageExceptionWhenTemplateNotFound() throws Exception {
  		TemplateBasedApplier applier = new TemplateBasedApplier(new NullWriter(), "some_complete_rubbish", null, ";", DelimiterType.normal, null);
  		try {
  			applier.apply(null);
  			Assert.fail("expected exception");
  		} catch (UsageException e) {
  			assertThat(e.getMessage(), is("Could not find template named some_complete_rubbish_apply.ftl\n" +
  					"Check that you have got the name of the database syntax correct."));
  		}
  	}
test_case.class_method_signature: TemplateBasedApplierTest.shouldThrowUsageExceptionWhenTemplateNotFound()
test_case.full_signature: @Test public void shouldThrowUsageExceptionWhenTemplateNotFound()
test_case.identifier: shouldThrowUsageExceptionWhenTemplateNotFound
test_case.invocations: apply fail assertThat getMessage is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldThrowUsageExceptionWhenTemplateNotFound()
focal_class.declarator: configuration
focal_class.modifier: private
focal_class.original_string: private Configuration configuration;
focal_class.type: Configuration
focal_class.var_name: configuration
focal_class.declarator: writer
focal_class.modifier: private
focal_class.original_string: private Writer writer;
focal_class.type: Writer
focal_class.var_name: writer
focal_class.declarator: syntax
focal_class.modifier: private
focal_class.original_string: private String syntax;
focal_class.type: String
focal_class.var_name: syntax
focal_class.declarator: changeLogTableName
focal_class.modifier: private
focal_class.original_string: private String changeLogTableName;
focal_class.type: String
focal_class.var_name: changeLogTableName
focal_class.declarator: delimiter
focal_class.modifier: private
focal_class.original_string: private String delimiter;
focal_class.type: String
focal_class.var_name: delimiter
focal_class.declarator: delimiterType
focal_class.modifier: private
focal_class.original_string: private DelimiterType delimiterType;
focal_class.type: DelimiterType
focal_class.var_name: delimiterType
focal_class.file: dbdeploy-core/src/main/java/com/dbdeploy/appliers/TemplateBasedApplier.java
focal_class.identifier: TemplateBasedApplier
focal_class.interfaces: implements ChangeScriptApplier
focal_class.class_method_signature: TemplateBasedApplier.TemplateBasedApplier(Writer writer, String syntax, String changeLogTableName, String delimiter, DelimiterType delimiterType, File templateDirectory)
focal_class.full_signature: public  TemplateBasedApplier(Writer writer, String syntax, String changeLogTableName, String delimiter, DelimiterType delimiterType, File templateDirectory)
focal_class.identifier: TemplateBasedApplier
focal_class.modifiers: public
focal_class.parameters: (Writer writer, String syntax, String changeLogTableName, String delimiter, DelimiterType delimiterType, File templateDirectory)
focal_class.signature:  TemplateBasedApplier(Writer writer, String syntax, String changeLogTableName, String delimiter, DelimiterType delimiterType, File templateDirectory)
focal_class.class_method_signature: TemplateBasedApplier.createFileTemplateLoader(File templateDirectory)
focal_class.full_signature: private FileTemplateLoader createFileTemplateLoader(File templateDirectory)
focal_class.identifier: createFileTemplateLoader
focal_class.modifiers: private
focal_class.parameters: (File templateDirectory)
focal_class.return: FileTemplateLoader
focal_class.signature: FileTemplateLoader createFileTemplateLoader(File templateDirectory)
focal_class.class_method_signature: TemplateBasedApplier.apply(List<ChangeScript> changeScripts)
focal_class.full_signature: public void apply(List<ChangeScript> changeScripts)
focal_class.identifier: apply
focal_class.modifiers: public
focal_class.parameters: (List<ChangeScript> changeScripts)
focal_class.return: void
focal_class.signature: void apply(List<ChangeScript> changeScripts)
focal_class.class_method_signature: TemplateBasedApplier.getTemplateQualifier()
focal_class.full_signature: protected String getTemplateQualifier()
focal_class.identifier: getTemplateQualifier
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTemplateQualifier()
focal_method.body: public void apply(List<ChangeScript> changeScripts) {
  		String filename = syntax + "_" + getTemplateQualifier() + ".ftl";
  
  		try {
  			Map<String, Object> model = new HashMap<String, Object>();
  			model.put("scripts", changeScripts);
  			model.put("changeLogTableName", changeLogTableName);
  			model.put("delimiter", delimiter);
  			model.put("separator", delimiterType == DelimiterType.row ? "\n" : "");
  
  			try {
  				Template template = configuration.getTemplate(filename);
  				template.process(model, writer);
  			} finally {
  				writer.close();
  			}
  		} catch (FileNotFoundException ex) {
  			throw new UsageException("Could not find template named " + filename + "\n" +
  					"Check that you have got the name of the database syntax correct.", ex);
  		} catch (Exception e) {
  			throw new RuntimeException(e);
  		}
  	}
focal_method.class_method_signature: TemplateBasedApplier.apply(List<ChangeScript> changeScripts)
focal_method.full_signature: public void apply(List<ChangeScript> changeScripts)
focal_method.identifier: apply
focal_method.invocations: getTemplateQualifier put put put put getTemplate process close
focal_method.modifiers: public
focal_method.parameters: (List<ChangeScript> changeScripts)
focal_method.return: void
focal_method.signature: void apply(List<ChangeScript> changeScripts)