@Test
public void testChangeRoboconfLogLevel() throws Exception {

	// Null => no exception
	AgentUtils.changeRoboconfLogLevel( Level.FINE.toString(), null );
	// Create an empty directory => no log file to update
	File karafEtc = this.folder.newFolder();
	Assert.assertEquals( 0, karafEtc.listFiles().length );
	AgentUtils.changeRoboconfLogLevel( Level.FINE.toString(), karafEtc.getAbsolutePath());
	Assert.assertEquals( 0, karafEtc.listFiles().length );
	// Create a new file to update
	File configFile = new File( karafEtc, "org.ops4j.pax.logging.cfg" );
	Assert.assertTrue( configFile.createNewFile());
	Assert.assertEquals( 0, configFile.length());
	AgentUtils.changeRoboconfLogLevel( Level.FINE.toString(), karafEtc.getAbsolutePath());
	String content = Utils.readFileContent( configFile );
	Assert.assertTrue( content.contains( Level.FINE.toString() + ", roboconf" ));
	// Try a new update
	AgentUtils.changeRoboconfLogLevel( Level.SEVERE.toString(), karafEtc.getAbsolutePath());
	content = Utils.readFileContent( configFile );
	Assert.assertTrue( content.contains( Level.SEVERE.toString() + ", roboconf" ));
	Assert.assertFalse( content.contains( Level.FINE.toString() + ", roboconf" ));
}