@Test
public void testEvalCondition() throws Exception {

	RestHandler handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag = 0" );
	Map<String,String> map = new HashMap<String,String> ();
	Assert.assertFalse( handler.evalCondition( map ));
	map.put( "undefined", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag >= 0" );
	map.put( "lag", "1.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag == 0" );
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "yes" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag > 0" );
	map.put( "lag", "1.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag <= 0" );
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag < 0" );
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertTrue( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "yes" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag == yes" );
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "yes" );
	Assert.assertTrue( handler.evalCondition( map ));
	handler = new RestHandler();
	handler.setAgentId( APP_NAME, SCOPED_INSTANCE_PATH );
	handler.reset( null, EVENT_NAME, "check url that lag =       yes" );
	map.put( "lag", "1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "-1.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "0.0" );
	Assert.assertFalse( handler.evalCondition( map ));
	map.clear();
	map.put( "lag", "yes" );
	Assert.assertTrue( handler.evalCondition( map ));
}