@Test
public void testInjectConfigurations_fullSample() throws Exception {

	File karafEtc = this.folder.newFolder();
	File injectionDir = new File( karafEtc, AgentUtils.INJECTED_CONFIGS_DIR );
	Assert.assertTrue( injectionDir.mkdirs());
	// Valid template
	Utils.writeStringInto( "ip = <ip-address>\napp = <application-name>\n", new File( injectionDir, "valid1.cfg.tpl" ));
	Utils.writeStringInto( "I am <scoped-instance-path>", new File( injectionDir, "valid2.cfg.tpl" ));
	// Skipped (not templates or invalid target file)
	Utils.writeStringInto( "ip = <ip-address>\napp = <application-name>", new File( injectionDir, "not-a-template.cfg" ));
	Utils.writeStringInto( "I am <scoped-instance-path>", new File( injectionDir, Constants.KARAF_CFG_FILE_AGENT + ".tpl" ));
	// Check
	Assert.assertEquals( 1, karafEtc.listFiles().length );
	AgentUtils.injectConfigurations( karafEtc.getAbsolutePath(), "app", "/vm", "default", "127.0.0.1" );
	Assert.assertEquals( 3, karafEtc.listFiles().length );
	File f = new File( karafEtc, "valid1.cfg" );
	Assert.assertTrue( f.isFile());
	Assert.assertEquals( "ip = 127.0.0.1\napp = app\n", Utils.readFileContent( f ));
	f = new File( karafEtc, "valid2.cfg" );
	Assert.assertTrue( f.isFile());
	Assert.assertEquals( "I am /vm", Utils.readFileContent( f ));
}