@Test public void dateNamespaceWithExpr() throws Exception { VariableResolverImpl vri = new VariableResolverImpl(); vri.context = new ContextImpl(null,vri, null, Context.FULL_DUMP, Collections.EMPTY_MAP, null,null); vri.addNamespace("dataimporter.functions", EvaluatorBag .getFunctionsNamespace(Collections.EMPTY_LIST,null)); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); format.setTimeZone(TimeZone.getTimeZone("UTC")); DateMathParser dmp = new DateMathParser(TimeZone.getDefault(), Locale.getDefault()); String s = vri.replaceTokens("${dataimporter.functions.formatDate('NOW/DAY','yyyy-MM-dd HH:mm')}"); Assert.assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(dmp.parseMath("/DAY")), s); }
public abstract String replaceTokens(String template);
VariableResolver { public abstract String replaceTokens(String template); }
VariableResolver { public abstract String replaceTokens(String template);  }
VariableResolver { public abstract String replaceTokens(String template);  abstract Object resolve(String name); abstract String replaceTokens(String template); }
VariableResolver { public abstract String replaceTokens(String template);  abstract Object resolve(String name); abstract String replaceTokens(String template);  }