@Test
public void testGenerate_defaultDirectory() throws Exception {

	// Copy a template
	File dir = this.folder.newFolder();
	File tplFile = new File( dir, "basic.txt.tpl" );
	InputStream in = getClass().getResourceAsStream( "/templates/basic.txt.tpl" );
	try {
		Utils.copyStream( in, tplFile );
	} finally {
		Utils.closeQuietly( in );
	}
	// Compile and verify it
	TemplateEntry te = new TemplateWatcher( null, dir, 100 ).compileTemplate( tplFile );
	Assert.assertNotNull( te );
	Assert.assertNull( te.getAppName());
	Assert.assertEquals( tplFile, te.getTemplateFile());
	Assert.assertNotNull( te.getTemplate());
	// Apply it to a given application
	Logger logger = Logger.getLogger( getClass().getName());
	File outputDir = this.folder.newFolder();
	Application app = GenerationTest.testApplicationForTemplates();
	Assert.assertEquals( 0, outputDir.listFiles().length );
	TemplateUtils.generate( app, outputDir, Collections.singleton( te ), logger );
	Assert.assertEquals( 1, outputDir.listFiles().length );
	File targetFile = new File( outputDir, app.getName() + "/basic.txt" );
	Assert.assertTrue( targetFile.exists());
	String currentContent = Utils.readFileContent( targetFile );
	File expectedFile =  TestUtils.findTestFile( "/output/basic.txt" );
	String expectedContent = Utils.readFileContent( expectedFile );
	Assert.assertEquals( expectedContent, currentContent );
}