public String getModuleName() {
return "org.fusesource.restygwt.VolatileQueueableCacheStorageTestGwt";
}
public void testTimeout() throws Exception{
final VolatileQueueableCacheStorage storage = new VolatileQueueableCacheStorage(100);
final CacheKey key = new SimpleCacheKey("first");
Response resp = new ResponseMock();
storage.putResult(key, resp);
// hashCode should be good enough
assertEquals(resp.hashCode(), storage.getResultOrReturnNull(key).hashCode());
Timer timer = new Timer() {
@Override
public void run() {
assertNull(storage.getResultOrReturnNull(key));
finishTest();
}
};
timer.schedule(200);