use of org.apache.dubbo.cache.Cache in project dubbo by alibaba.
the class ExpiringCacheFactoryTest method testExpiringCacheGetExpired.
@Test
public void testExpiringCacheGetExpired() throws Exception {
URL url = URL.valueOf("test://test:12/test?cache=expiring&cache.seconds=1&cache.interval=1");
AbstractCacheFactory cacheFactory = getCacheFactory();
Invocation invocation = new RpcInvocation();
Cache cache = cacheFactory.getCache(url, invocation);
cache.put("testKey", "testValue");
Thread.sleep(2100);
assertNull(cache.get("testKey"));
}
use of org.apache.dubbo.cache.Cache in project dubbo by alibaba.
the class LruCacheFactoryTest method testLruCacheFactory.
@Test
public void testLruCacheFactory() throws Exception {
Cache cache = super.constructCache();
assertThat(cache instanceof LruCache, is(true));
}
Aggregations