Assert.assertEquals(CoordELFunctions.evalAndWrap(eval, "${user()}"), "test");
}
@Test
public void testDataIn() throws Exception {
ELEvaluator eval = createActionStartEvaluator();
String uris = "hdfs://localhost:8020/clicks/2009/09/02/10,hdfs://localhost:8020/clicks/2009/09/02/09";
eval.setVariable(".datain.clicks", uris);
String expuris =
"hdfs://localhost:8020/clicks/2009/09/02/10/*/US,hdfs://localhost:8020/clicks/2009/09/02/09/*/US";
Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));
//test optional input
String inName = "clicks";
SyncCoordDataset ds = createDataSet("2007-09-30T010:00Z");
eval.setVariable(inName + ".frequency", String.valueOf(ds.getFrequency()));
eval.setVariable(inName + ".freq_timeunit", ds.getTimeUnit().name());
eval.setVariable(inName + ".timezone", ds.getTimeZone().getID());
eval.setVariable(inName + ".end_of_duration", Timeunit.NONE.name());
eval.setVariable(inName + ".initial-instance", OozieELExtensions.formatDateUTC(ds.getInitInstance()));
eval.setVariable(inName + ".done-flag", "notused");
eval.setVariable(inName + ".uri-template", ds.getUriTemplate());
eval.setVariable(inName + ".start-instance", "now(-1,0)");
eval.setVariable(inName + ".end-instance", "now(0,0)");
// TODO Had to comment this out for this test to PASS else NPE in
// TODO org.apache.oozie.command.coord.CoordCommandUtils.createEarlyURIs(CoordCommandUtils.java:359)
// eval.setVariable(".datain.clicks", null);
Assert.assertEquals(expuris, CoordELFunctions.evalAndWrap(eval, "${dataIn('clicks', '*/US')}"));
}