示例#1
0
 @GwtIncompatible("refreshAfterWrite")
 public void testRefresh_zero() {
   CacheBuilder<Object, Object> builder = new CacheBuilder<Object, Object>();
   try {
     builder.refreshAfterWrite(0, SECONDS);
     fail();
   } catch (IllegalArgumentException expected) {
   }
 }
示例#2
0
 @GwtIncompatible("refreshAfterWrite")
 public void testRefresh_setTwice() {
   CacheBuilder<Object, Object> builder =
       new CacheBuilder<Object, Object>().refreshAfterWrite(3600, SECONDS);
   try {
     // even to the same value is not allowed
     builder.refreshAfterWrite(3600, SECONDS);
     fail();
   } catch (IllegalStateException expected) {
   }
 }
示例#3
0
 public com.google.common.cache.CacheBuilder<Object, Object> refreshAfterWrite(
     long duration, TimeUnit unit) {
   return builder.refreshAfterWrite(duration, unit);
 }