action.setName("H");
ActionXCommand.ActionExecutorContext context = new ActionXCommand.ActionExecutorContext(workflow, action, false, false);
context.setVar(MapReduceActionExecutor.HADOOP_COUNTERS, pigStats);
ELEvaluator eval = Services.get().get(ELService.class).createEvaluator("workflow");
DagELFunctions.configureEvaluator(eval, workflow, action);
String version = "0.9.0";
String jobGraph = "job_201111300933_0004,job_201111300933_0005";
String job1Stats = "{\"MAP_INPUT_RECORDS\":\"33\",\"MIN_REDUCE_TIME\":\"0\",\"MULTI_STORE_COUNTERS\":{},\"ERROR_MESSAGE\":null,\"JOB_ID\":\"job_201111300933_0004\"}";
String job2Stats = "{\"MAP_INPUT_RECORDS\":\"37\",\"MIN_REDUCE_TIME\":\"0\",\"MULTI_STORE_COUNTERS\":{},\"ERROR_MESSAGE\":null,\"JOB_ID\":\"job_201111300933_0005\"}";
assertEquals(ActionType.PIG.toString(), eval.evaluate("${hadoop:counters('H')['ACTION_TYPE']}", String.class));
assertEquals(version, eval.evaluate("${hadoop:counters('H')['PIG_VERSION']}", String.class));
assertEquals(jobGraph, eval.evaluate("${hadoop:counters('H')['JOB_GRAPH']}", String.class));
assertEquals(job1Stats, eval.evaluate("${hadoop:counters('H')['job_201111300933_0004']}", String.class));
assertEquals(job2Stats, eval.evaluate("${hadoop:counters('H')['job_201111300933_0005']}", String.class));
assertEquals(new Long(33),
eval.evaluate("${hadoop:counters('H')['job_201111300933_0004']['MAP_INPUT_RECORDS']}", Long.class));
}