added negative tests so that we know what to update when guava 10.0 final is out

This commit is contained in:
Adrian Cole 2011-09-22 10:43:04 -07:00
parent b0e2dccd43
commit 78d2564ba3
1 changed files with 14 additions and 0 deletions

View File

@ -59,6 +59,20 @@ public class CacheLearningTest {
} catch (NullPointerException e) { } catch (NullPointerException e) {
assertEquals(e.getMessage(), "testLoader returned null for key foo."); assertEquals(e.getMessage(), "testLoader returned null for key foo.");
} }
try {
assertEquals(cache.activeEntries(Integer.MAX_VALUE).size(), 1);
assert false : "I suppose this works now! Go hunt asMap().keySet()!";
} catch (UnsupportedOperationException e) {
}
try {
cache.asMap().put("foo", "bar");
assertEquals(cache.get("foo"), "bar");
assert false : "I suppose this works now! Go hunt for invalidate calls!";
} catch (UnsupportedOperationException e) {
}
try { try {
cache.get("exception"); cache.get("exception");
} catch (ExecutionException e) { } catch (ExecutionException e) {