コード例 #1
0
 private CacheItem putAndGet(HTTPRequest request) {
   HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers());
   response = storage.insert(REQUEST, response);
   response.consume();
   assertEquals(1, storage.size());
   return storage.get(request);
 }
コード例 #2
0
 @Test
 public void testPutCacheItem() {
   HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers());
   response = storage.insert(REQUEST, response);
   response.consume();
   assertEquals(1, storage.size());
 }
コード例 #3
0
 @Test
 public void testInvalidate() {
   HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers());
   URI requestURI = URI.create("foo");
   HTTPResponse res = storage.insert(REQUEST, response);
   res.consume();
   assertEquals(1, storage.size());
   storage.invalidate(requestURI);
   assertEquals(0, storage.size());
 }