Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2CF3C200CA6 for ; Mon, 29 May 2017 21:17:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2C0B6160BCE; Mon, 29 May 2017 19:17:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4BE69160BC6 for ; Mon, 29 May 2017 21:17:07 +0200 (CEST) Received: (qmail 52830 invoked by uid 500); 29 May 2017 19:17:06 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 52820 invoked by uid 99); 29 May 2017 19:17:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2017 19:17:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 64E64DFC2E; Mon, 29 May 2017 19:17:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: olegk@apache.org To: commits@hc.apache.org Date: Mon, 29 May 2017 19:17:06 -0000 Message-Id: <6413d5a081974f55bb4788ba75b6606f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] httpcomponents-client git commit: Removing unnecessary checks for cache invalidation calls. archived-at: Mon, 29 May 2017 19:17:08 -0000 Repository: httpcomponents-client Updated Branches: refs/heads/4.5.x 0b6adcc59 -> dac57c57f Removing unnecessary checks for cache invalidation calls. Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/10ab37b7 Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/10ab37b7 Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/10ab37b7 Branch: refs/heads/4.5.x Commit: 10ab37b775bd4f3fdf82c84ab59fbc30b41e8197 Parents: 0b6adcc Author: Leandro Nunes Authored: Thu May 18 15:12:05 2017 +0100 Committer: Leandro Nunes Committed: Thu May 18 15:12:05 2017 +0100 ---------------------------------------------------------------------- .../org/apache/http/impl/client/cache/TestCachingExec.java | 3 --- .../apache/http/impl/client/cache/TestCachingExecChain.java | 9 --------- .../http/impl/client/cache/TestProtocolRequirements.java | 6 ------ 3 files changed, 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/10ab37b7/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java ---------------------------------------------------------------------- diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java index abda62a..553163a 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java @@ -170,7 +170,6 @@ public class TestCachingExec extends TestCachingExecChain { @Test public void testCacheMissCausesBackendRequest() throws Exception { mockImplMethods(CALL_BACKEND); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); getCacheEntryReturns(null); getVariantCacheEntriesReturns(new HashMap()); @@ -192,7 +191,6 @@ public class TestCachingExec extends TestCachingExecChain { @Test public void testUnsuitableUnvalidatableCacheEntryCausesBackendRequest() throws Exception { mockImplMethods(CALL_BACKEND); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); requestIsFatallyNonCompliant(null); @@ -219,7 +217,6 @@ public class TestCachingExec extends TestCachingExecChain { @Test public void testUnsuitableValidatableCacheEntryCausesRevalidation() throws Exception { mockImplMethods(REVALIDATE_CACHE_ENTRY); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); requestIsFatallyNonCompliant(null); http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/10ab37b7/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java ---------------------------------------------------------------------- diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java index 852c1ca..f2ddc67 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java @@ -311,7 +311,6 @@ public abstract class TestCachingExecChain { @Test public void testSuitableCacheEntryDoesNotCauseBackendRequest() throws Exception { - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); getCacheEntryReturns(mockCacheEntry); cacheEntrySuitable(true); @@ -352,7 +351,6 @@ public abstract class TestCachingExecChain { public void testResponseIsGeneratedWhenCacheEntryIsUsable() throws Exception { requestIsFatallyNonCompliant(null); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); cacheEntrySuitable(true); getCacheEntryReturns(mockCacheEntry); @@ -1385,7 +1383,6 @@ public abstract class TestCachingExecChain { "must-revalidate") }); requestIsFatallyNonCompliant(null); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); getCacheEntryReturns(entry); cacheEntrySuitable(false); @@ -1403,7 +1400,6 @@ public abstract class TestCachingExecChain { request.setHeader("Cache-Control", "only-if-cached"); requestIsFatallyNonCompliant(null); - cacheInvalidatorWasCalled(); requestPolicyAllowsCaching(true); getCacheEntryReturns(entry); cacheEntrySuitable(true); @@ -1733,11 +1729,6 @@ public abstract class TestCachingExecChain { expect(mockCache.getCacheEntry(eq(host), eqRequest(request))).andReturn(result); } - private void cacheInvalidatorWasCalled() throws IOException { - mockCache - .flushInvalidatedCacheEntriesFor((HttpHost) anyObject(), (HttpRequest) anyObject()); - } - protected void cacheEntryValidatable(final boolean b) { expect(mockValidityPolicy.isRevalidatable((HttpCacheEntry) anyObject())).andReturn(b) .anyTimes(); http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/10ab37b7/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java ---------------------------------------------------------------------- diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java index 3378083..27afcd5 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java @@ -2504,8 +2504,6 @@ public class TestProtocolRequirements extends AbstractProtocolTest { notModified.setHeader("Date", DateUtils.formatDate(now)); notModified.setHeader("ETag", "\"etag\""); - mockCache.flushInvalidatedCacheEntriesFor(EasyMock.eq(host), - eqRequest(request)); EasyMock.expect( mockCache.getCacheEntry(EasyMock.eq(host), eqRequest(request))) .andReturn(entry); @@ -2551,7 +2549,6 @@ public class TestProtocolRequirements extends AbstractProtocolTest { impl = new CachingExec(mockBackend, mockCache, config); request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/thing", HttpVersion.HTTP_1_1)); - mockCache.flushInvalidatedCacheEntriesFor(EasyMock.eq(host), eqRequest(request)); EasyMock.expect(mockCache.getCacheEntry(EasyMock.eq(host), eqRequest(request))).andReturn(entry); replayMocks(); @@ -2599,7 +2596,6 @@ public class TestProtocolRequirements extends AbstractProtocolTest { impl = new CachingExec(mockBackend, mockCache, config); request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/thing", HttpVersion.HTTP_1_1)); - mockCache.flushInvalidatedCacheEntriesFor(EasyMock.eq(host), eqRequest(request)); EasyMock.expect(mockCache.getCacheEntry(EasyMock.eq(host), eqRequest(request))).andReturn(entry); EasyMock.expect( mockBackend.execute( @@ -2818,7 +2814,6 @@ public class TestProtocolRequirements extends AbstractProtocolTest { impl = new CachingExec(mockBackend, mockCache, config); request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/thing", HttpVersion.HTTP_1_1)); - mockCache.flushInvalidatedCacheEntriesFor(EasyMock.eq(host), eqRequest(request)); EasyMock.expect(mockCache.getCacheEntry(EasyMock.eq(host), eqRequest(request))).andReturn(entry); replayMocks(); @@ -2881,7 +2876,6 @@ public class TestProtocolRequirements extends AbstractProtocolTest { final Capture cap = new Capture(); - mockCache.flushInvalidatedCacheEntriesFor(EasyMock.eq(host), eqRequest(request)); mockCache.flushInvalidatedCacheEntriesFor( EasyMock.isA(HttpHost.class), EasyMock.isA(HttpRequestWrapper.class),