DynTokenResolver { public void setBaseToken(String name, String value) { baseTokens.put(name, value); } DynTokenResolver(DynTokenList tokenList); void setBaseToken(String name, String value); void resolve(); Map<String, String> getResolvedTokens();  }
@Test public void testSetBaseToken() { String filename = "REP12_20120809_20120811_RFVL.nc.gz"; StringDynToken token = new StringDynToken(); token.setName("runtime"); token.setBase("${FILENAME}"); token.setRegex(".*_([0-9]{4})([0-9]{2})([0-9]{2})_[0-9]{8}_.*"); token.setCompose("${1}-${2}-${3} 00:00:00"); DynTokenList tokenList = new DynTokenList(); tokenList.add(token); DynTokenResolver resolver = new DynTokenResolver(tokenList); resolver.setBaseToken("FILENAME", filename); resolver.resolve(); String runtime = resolver.getResolvedTokens().get("runtime"); assertEquals("2012-08-09 00:00:00", runtime); }