@Test
public void testCollectLogs() throws Exception {

	// Null => no resource
	Map<String,byte[]> map = AgentUtils.collectLogs( null );
	Assert.assertEquals( 0, map.size());
	// Empty directory => no resource
	File karafData = this.folder.newFolder();
	map = AgentUtils.collectLogs( karafData.getAbsolutePath());
	Assert.assertEquals( 0, map.size());
	// Find the logs directory
	File karafLog = new File( karafData, AgentConstants.KARAF_LOGS_DIRECTORY + "/karaf.log" );
	Assert.assertTrue( karafLog.getParentFile().mkdir());
	Assert.assertTrue( karafLog.createNewFile());
	map = AgentUtils.collectLogs( karafData.getAbsolutePath());
	Assert.assertEquals( 1, map.size());
	Assert.assertTrue( map.containsKey( "karaf.log" ));
	// Add other files
	String[] names = { "roboconf", "roboconf2", "whatever" };
	for( String s : names ) {
		karafLog = new File( karafData, AgentConstants.KARAF_LOGS_DIRECTORY + "/" + s + ".log" );
		Assert.assertTrue( karafLog.createNewFile());
	}
	map = AgentUtils.collectLogs( karafData.getAbsolutePath());
	Assert.assertEquals( 2, map.size());
	Assert.assertTrue( map.containsKey( "karaf.log" ));
	Assert.assertTrue( map.containsKey( "roboconf.log" ));
}