Issue 690:Update to guava 10.0-rc3

This commit is contained in:
Adrian Cole 2011-09-25 12:01:41 -07:00
parent fc5d172523
commit 09cef638ed
2 changed files with 12 additions and 8 deletions

View File

@ -109,7 +109,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0-rc2</version>
<version>10.0-rc3</version>
</dependency>
</dependencies>

View File

@ -56,15 +56,13 @@ public class CacheLearningTest {
});
try {
cache.get("foo");
assert false : "expected exception on miss";
} catch (NullPointerException e) {
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) {
}
assertEquals(cache.asMap().keySet().size(), 0);
assertEquals(cache.asMap().size(), 0);
try {
cache.asMap().put("foo", "bar");
@ -75,19 +73,25 @@ public class CacheLearningTest {
try {
cache.get("exception");
assert false : "expected checked exception in loader to rethrow as ExecutionException";
} catch (ExecutionException e) {
assertEquals(e.getMessage(), "java.lang.Exception: exception");
}
try {
cache.get("runtimeexception");
assert false : "expected unchecked exception in loader to rethrow as UncheckedExecutionException";
} catch (UncheckedExecutionException e) {
assertEquals(e.getMessage(), "java.lang.RuntimeException: runtimeexception");
}
try {
cache.getUnchecked("exception");
assert false : "expected checked exception in loader to rethrow as UncheckedExecutionException, when getUnchecked called";
} catch (UncheckedExecutionException e) {
assertEquals(e.getMessage(), "java.lang.Exception: exception");
}
assertEquals(cache.get("bar"), "bar");
assertEquals(cache.get("baz"), "baz");
assertEquals(cache.asMap().size(), 2);