@Test
public void testExtractRuleSections_file() throws Exception {

	File f = TestUtils.findTestFile( "/file-events.conf" );
	String fileContent = Utils.readFileContent( f );
	MonitoringRunnable task = new MonitoringRunnable( this.agentInterface, HANDLERS );
	this.agentInterface.setScopedInstance( new Instance( "root" ));
	List<MonitoringHandlerRun> handlers = task.extractRuleSections( f, fileContent, null );
	Assert.assertEquals( 3, handlers.size());
	MonitoringHandlerRun bean = handlers.get( 0 );
	Assert.assertEquals( "file", bean.handlerName );
	Assert.assertEquals( "myRuleName-1", bean.eventId );
	Assert.assertTrue( bean.rawRulesText.contains( "%TMP%/rbcf-test/ta-daaaaa" ));
	bean = handlers.get( 1 );
	Assert.assertEquals( "file", bean.handlerName );
	Assert.assertEquals( "myRuleName-2", bean.eventId );
	Assert.assertTrue( bean.rawRulesText.contains( "%TMP%/rbcf-test/ta-daaaaa-2" ));
	bean = handlers.get( 2 );
	Assert.assertEquals( "file", bean.handlerName );
	Assert.assertEquals( "myRuleName", bean.eventId );
	Assert.assertTrue( bean.rawRulesText.contains( "%TMP%/rbcf-test/a-directory-to-not-delete" ));
}