TreeCache getData() method returns null instead of mapped value from the node. Please see the unit test case written in junit.
public class TreeCacheTest extends Assert {
@Test
public void testTreeCache()
{
Configuration c = new Configuration();
c.setInvocationBatchingEnabled(true);
TreeCache<Object, Object> cache = new TreeCacheFactory().createTreeCache(new DefaultCacheManager(c).getCache());
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key1","TRADE1");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key2","TRADE2");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key3","TRADE3");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key4","TRADE4");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key5","TRADE5");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key6","TRADE6");
cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key7","TRADE7");
Object object = cache.get(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key7");
assertNotNull(object);
Map<Object, Object> data = cache.getData(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")));
assertNotNull(data);
}
private Fqn getBase()
{
return Fqn.fromString("SYSTEMSTATUS");
}
}