Update the test too.

This commit is contained in:
Par Winzell
2009-01-24 23:11:46 +00:00
parent 9e41b41994
commit 9119cc9313
@@ -69,15 +69,13 @@ public class TestCacheAdapter implements CacheAdapter
// System.err.println("REMOVE " + key); // System.err.println("REMOVE " + key);
_cache.remove(new Tuple<String, Serializable>(cacheId, key)); _cache.remove(new Tuple<String, Serializable>(cacheId, key));
} }
public <T> Iterable<Tuple<Serializable, CachedValue<T>>> enumerate (String cacheId) public <T> Iterable<Serializable> enumerate (String cacheId)
{ {
// in a real implementation this would be a lazily constructed iterable // in a real implementation this would be a lazily constructed iterable
List<Tuple<Serializable, CachedValue<T>>> result = Lists.newArrayList(); List<Serializable> result = Lists.newArrayList();
for (Map.Entry<Tuple<String, Serializable>, CachedValue<?>> entry: _cache.entrySet()) { for (Map.Entry<Tuple<String, Serializable>, CachedValue<?>> entry: _cache.entrySet()) {
if (entry.getKey().left.equals(cacheId)) { if (entry.getKey().left.equals(cacheId)) {
@SuppressWarnings("unchecked") result.add(entry.getKey().right);
CachedValue<T> value = (CachedValue<T>) entry.getValue();
result.add(Tuple.newTuple(entry.getKey().right, value));
} }
} }
return result; return result;