hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1395613 - in /httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http: client/cache/ impl/client/cache/ impl/client/cache/ehcache/ impl/client/cache/memcached/
Date Mon, 08 Oct 2012 15:26:51 GMT
Author: olegk
Date: Mon Oct  8 15:26:50 2012
New Revision: 1395613

URL: http://svn.apache.org/viewvc?rev=1395613&view=rev
Log:
HTTPCLIENT-1244: relaxed EasyMock based unit tests in the Caching module
Contributed by Joe Campbell <joseph.r.campbell at gmail.com>

Modified:
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/client/cache/TestHttpCacheEntry.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/AbstractProtocolTest.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/DoNotTestProtocolRequirements.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java
    httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/client/cache/TestHttpCacheEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/client/cache/TestHttpCacheEntry.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/client/cache/TestHttpCacheEntry.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/client/cache/TestHttpCacheEntry.java
Mon Oct  8 15:26:50 2012
@@ -59,7 +59,7 @@ public class TestHttpCacheEntry {
         nineSecondsAgo = new Date(now.getTime() - 9 * 1000L);
         statusLine = new BasicStatusLine(HttpVersion.HTTP_1_1,
                 HttpStatus.SC_OK, "OK");
-        mockResource = createMock(Resource.class);
+        mockResource = createNiceMock(Resource.class);
     }
 
     private HttpCacheEntry makeEntry(Header[] headers) {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/AbstractProtocolTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/AbstractProtocolTest.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/AbstractProtocolTest.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/AbstractProtocolTest.java
Mon Oct  8 15:26:50 2012
@@ -73,8 +73,8 @@ public abstract class AbstractProtocolTe
         params.setMaxCacheEntries(MAX_ENTRIES);
         params.setMaxObjectSize(MAX_BYTES);
         cache = new BasicHttpCache(params);
-        mockBackend = EasyMock.createMock(HttpClient.class);
-        mockCache = EasyMock.createMock(HttpCache.class);
+        mockBackend = EasyMock.createNiceMock(HttpClient.class);
+        mockCache = EasyMock.createNiceMock(HttpCache.class);
         impl = new CachingHttpClient(mockBackend, cache, params);
     }
 
@@ -95,8 +95,8 @@ public abstract class AbstractProtocolTe
     }
 
     protected void emptyMockCacheExpectsNoPuts() throws Exception {
-        mockBackend = EasyMock.createMock(HttpClient.class);
-        mockCache = EasyMock.createMock(HttpCache.class);
+        mockBackend = EasyMock.createNiceMock(HttpClient.class);
+        mockCache = EasyMock.createNiceMock(HttpCache.class);
 
         impl = new CachingHttpClient(mockBackend, mockCache, params);
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/DoNotTestProtocolRequirements.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/DoNotTestProtocolRequirements.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/DoNotTestProtocolRequirements.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/DoNotTestProtocolRequirements.java
Mon Oct  8 15:26:50 2012
@@ -79,9 +79,9 @@ public class DoNotTestProtocolRequiremen
         params.setMaxCacheEntries(MAX_ENTRIES);
 
         HttpCache cache = new BasicHttpCache(params);
-        mockBackend = EasyMock.createMock(HttpClient.class);
-        mockEntity = EasyMock.createMock(HttpEntity.class);
-        mockCache = EasyMock.createMock(HttpCache.class);
+        mockBackend = EasyMock.createNiceMock(HttpClient.class);
+        mockEntity = EasyMock.createNiceMock(HttpEntity.class);
+        mockCache = EasyMock.createNiceMock(HttpCache.class);
         impl = new CachingHttpClient(mockBackend, cache, params);
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java
Mon Oct  8 15:26:50 2012
@@ -49,12 +49,12 @@ public class TestAsynchronousValidationR
 
     @Before
     public void setUp() {
-        mockParent = EasyMock.createMock(AsynchronousValidator.class);
-        mockClient = EasyMock.createMock(CachingHttpClient.class);
+        mockParent = EasyMock.createNiceMock(AsynchronousValidator.class);
+        mockClient = EasyMock.createNiceMock(CachingHttpClient.class);
         target = new HttpHost("foo.example.com");
         request = new HttpGet("/");
-        mockContext = EasyMock.createMock(HttpContext.class);
-        mockCacheEntry = EasyMock.createMock(HttpCacheEntry.class);
+        mockContext = EasyMock.createNiceMock(HttpContext.class);
+        mockCacheEntry = EasyMock.createNiceMock(HttpCacheEntry.class);
     }
 
     @Test

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
Mon Oct  8 15:26:50 2012
@@ -61,13 +61,13 @@ public class TestAsynchronousValidator {
 
     @Before
     public void setUp() {
-        mockClient = EasyMock.createMock(CachingHttpClient.class);
+        mockClient = EasyMock.createNiceMock(CachingHttpClient.class);
         target = new HttpHost("foo.example.com");
         request = new HttpGet("/");
-        mockContext = EasyMock.createMock(HttpContext.class);
-        mockCacheEntry = EasyMock.createMock(HttpCacheEntry.class);
+        mockContext = EasyMock.createNiceMock(HttpContext.class);
+        mockCacheEntry = EasyMock.createNiceMock(HttpCacheEntry.class);
 
-        mockExecutor = EasyMock.createMock(ExecutorService.class);
+        mockExecutor = EasyMock.createNiceMock(ExecutorService.class);
 
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
Mon Oct  8 15:26:50 2012
@@ -73,9 +73,9 @@ public class TestCacheInvalidator {
         tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
 
         host = new HttpHost("foo.example.com");
-        mockStorage = createMock(HttpCacheStorage.class);
+        mockStorage = createNiceMock(HttpCacheStorage.class);
         cacheKeyGenerator = new CacheKeyGenerator();
-        mockEntry = createMock(HttpCacheEntry.class);
+        mockEntry = createNiceMock(HttpCacheEntry.class);
         request = HttpTestUtils.makeDefaultRequest();
         response = HttpTestUtils.make200Response();
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java
Mon Oct  8 15:26:50 2012
@@ -53,8 +53,8 @@ public class TestCacheKeyGenerator {
     @Before
     public void setUp() throws Exception {
         host = new HttpHost("foo.example.com");
-        mockEntry = EasyMock.createMock(HttpCacheEntry.class);
-        mockRequest = EasyMock.createMock(HttpRequest.class);
+        mockEntry = EasyMock.createNiceMock(HttpCacheEntry.class);
+        mockRequest = EasyMock.createNiceMock(HttpRequest.class);
         extractor = new CacheKeyGenerator();
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java
Mon Oct  8 15:26:50 2012
@@ -57,7 +57,7 @@ public class TestCachedHttpResponseGener
                 new BasicHeader("Content-Length", "150") };
 
         entry = HttpTestUtils.makeCacheEntry(tenSecondsAgo, sixSecondsAgo, hdrs);
-        mockValidityPolicy = EasyMock.createMock(CacheValidityPolicy.class);
+        mockValidityPolicy = EasyMock.createNiceMock(CacheValidityPolicy.class);
         impl = new CachedHttpResponseGenerator(mockValidityPolicy);
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java
Mon Oct  8 15:26:50 2012
@@ -63,7 +63,7 @@ public class TestCachedResponseSuitabili
 
         host = new HttpHost("foo.example.com");
         request = new BasicHttpRequest("GET", "/foo", HttpVersion.HTTP_1_1);
-        mockValidityPolicy = EasyMock.createMock(CacheValidityPolicy.class);
+        mockValidityPolicy = EasyMock.createNiceMock(CacheValidityPolicy.class);
         entry = HttpTestUtils.makeCacheEntry();
 
         impl = new CachedResponseSuitabilityChecker(new CacheConfig());

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingHttpClient.java
Mon Oct  8 15:26:50 2012
@@ -115,25 +115,25 @@ public class TestCachingHttpClient {
     @SuppressWarnings("unchecked")
     @Before
     public void setUp() {
-        mockRequestPolicy = createMock(CacheableRequestPolicy.class);
-        mockValidityPolicy = createMock(CacheValidityPolicy.class);
-        mockBackend = createMock(HttpClient.class);
-        mockCache = createMock(HttpCache.class);
-        mockSuitabilityChecker = createMock(CachedResponseSuitabilityChecker.class);
-        mockResponsePolicy = createMock(ResponseCachingPolicy.class);
-        mockConnectionManager = createMock(ClientConnectionManager.class);
-        mockHandler = createMock(ResponseHandler.class);
-        mockBackendResponse = createMock(HttpResponse.class);
-        mockUriRequest = createMock(HttpUriRequest.class);
-        mockCacheEntry = createMock(HttpCacheEntry.class);
-        mockResponseGenerator = createMock(CachedHttpResponseGenerator.class);
-        mockCachedResponse = createMock(HttpResponse.class);
-        mockConditionalRequestBuilder = createMock(ConditionalRequestBuilder.class);
-        mockConditionalRequest = createMock(HttpRequest.class);
-        mockStatusLine = createMock(StatusLine.class);
-        mockResponseProtocolCompliance = createMock(ResponseProtocolCompliance.class);
-        mockRequestProtocolCompliance = createMock(RequestProtocolCompliance.class);
-        mockStorage = createMock(HttpCacheStorage.class);
+        mockRequestPolicy = createNiceMock(CacheableRequestPolicy.class);
+        mockValidityPolicy = createNiceMock(CacheValidityPolicy.class);
+        mockBackend = createNiceMock(HttpClient.class);
+        mockCache = createNiceMock(HttpCache.class);
+        mockSuitabilityChecker = createNiceMock(CachedResponseSuitabilityChecker.class);
+        mockResponsePolicy = createNiceMock(ResponseCachingPolicy.class);
+        mockConnectionManager = createNiceMock(ClientConnectionManager.class);
+        mockHandler = createNiceMock(ResponseHandler.class);
+        mockBackendResponse = createNiceMock(HttpResponse.class);
+        mockUriRequest = createNiceMock(HttpUriRequest.class);
+        mockCacheEntry = createNiceMock(HttpCacheEntry.class);
+        mockResponseGenerator = createNiceMock(CachedHttpResponseGenerator.class);
+        mockCachedResponse = createNiceMock(HttpResponse.class);
+        mockConditionalRequestBuilder = createNiceMock(ConditionalRequestBuilder.class);
+        mockConditionalRequest = createNiceMock(HttpRequest.class);
+        mockStatusLine = createNiceMock(StatusLine.class);
+        mockResponseProtocolCompliance = createNiceMock(ResponseProtocolCompliance.class);
+        mockRequestProtocolCompliance = createNiceMock(RequestProtocolCompliance.class);
+        mockStorage = createNiceMock(HttpCacheStorage.class);
 
         requestDate = new Date(System.currentTimeMillis() - 1000);
         responseDate = new Date();
@@ -2159,7 +2159,7 @@ public class TestCachingHttpClient {
                 mockSuitabilityChecker,
                 mockConditionalRequestBuilder,
                 mockResponseProtocolCompliance,
-                mockRequestProtocolCompliance).addMockedMethods(methods).createMock();
+                mockRequestProtocolCompliance).addMockedMethods(methods).createNiceMock();
     }
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java
Mon Oct  8 15:26:50 2012
@@ -38,7 +38,7 @@ public class TestCombinedEntity {
 
     @Test
     public void testCombinedEntityBasics() throws Exception {
-        Resource resource = EasyMock.createMock(Resource.class);
+        Resource resource = EasyMock.createNiceMock(Resource.class);
         EasyMock.expect(resource.getInputStream()).andReturn(
                 new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 }));
         resource.dispose();

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
Mon Oct  8 15:26:50 2012
@@ -91,7 +91,7 @@ public class TestHttpCacheJiraNumber1147
         ResourceFactory resourceFactory = new FileResourceFactory(cacheDir);
         HttpCacheStorage httpCacheStorage = new ManagedHttpCacheStorage(cacheConfig);
 
-        HttpClient client = EasyMock.createMock(HttpClient.class);
+        HttpClient client = EasyMock.createNiceMock(HttpClient.class);
         HttpGet get = new HttpGet("http://somehost/");
         HttpContext context = new BasicHttpContext();
         HttpHost target = new HttpHost("somehost");

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java
Mon Oct  8 15:26:50 2012
@@ -98,9 +98,9 @@ public class TestProtocolDeviations {
         params.setMaxCacheEntries(MAX_ENTRIES);
 
         HttpCache cache = new BasicHttpCache(params);
-        mockBackend = EasyMock.createMock(HttpClient.class);
-        mockEntity = EasyMock.createMock(HttpEntity.class);
-        mockCache = EasyMock.createMock(HttpCache.class);
+        mockBackend = EasyMock.createNiceMock(HttpClient.class);
+        mockEntity = EasyMock.createNiceMock(HttpEntity.class);
+        mockCache = EasyMock.createNiceMock(HttpCache.class);
 
         impl = new CachingHttpClient(mockBackend, cache, params);
     }
@@ -203,7 +203,7 @@ public class TestProtocolDeviations {
         (new Random()).nextBytes(bytes);
 
         HttpEntity mockBody = EasyMock.createMockBuilder(ByteArrayEntity.class).withConstructor(
-                new Object[] { bytes }).addMockedMethods("getContentLength").createMock();
+                new Object[] { bytes }).addMockedMethods("getContentLength").createNiceMock();
         org.easymock.EasyMock.expect(mockBody.getContentLength()).andReturn(-1L).anyTimes();
         post.setEntity(mockBody);
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolRequirements.java
Mon Oct  8 15:26:50 2012
@@ -550,7 +550,7 @@ public class TestProtocolRequirements ex
     public void testRequestsExpecting100ContinueBehaviorShouldSetExpectHeader() throws Exception
{
         BasicHttpEntityEnclosingRequest post = EasyMock.createMockBuilder(
                 BasicHttpEntityEnclosingRequest.class).withConstructor("POST", "/", HttpVersion.HTTP_1_1)
-                .addMockedMethods("expectContinue").createMock();
+                .addMockedMethods("expectContinue").createNiceMock();
         post.setEntity(new BasicHttpEntity());
         post.setHeader("Content-Length", "128");
 
@@ -595,7 +595,7 @@ public class TestProtocolRequirements ex
             throws Exception {
         BasicHttpEntityEnclosingRequest post = EasyMock.createMockBuilder(
                 BasicHttpEntityEnclosingRequest.class).withConstructor("POST", "/", HttpVersion.HTTP_1_1)
-                .addMockedMethods("expectContinue").createMock();
+                .addMockedMethods("expectContinue").createNiceMock();
         post.setEntity(new BasicHttpEntity());
         post.setHeader("Content-Length", "128");
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java
Mon Oct  8 15:26:50 2012
@@ -51,10 +51,10 @@ public class TestEhcacheHttpCacheStorage
 
     @Override
     public void setUp() {
-        mockCache = EasyMock.createMock(Ehcache.class);
+        mockCache = EasyMock.createNiceMock(Ehcache.class);
         CacheConfig config = new CacheConfig();
         config.setMaxUpdateRetries(1);
-        mockSerializer = EasyMock.createMock(HttpCacheEntrySerializer.class);
+        mockSerializer = EasyMock.createNiceMock(HttpCacheEntrySerializer.class);
         impl = new EhcacheHttpCacheStorage(mockCache, config, mockSerializer);
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java
Mon Oct  8 15:26:50 2012
@@ -71,7 +71,7 @@ public class TestEhcacheProtocolRequirem
         }
         CACHE_MANAGER.addCache(TEST_EHCACHE_NAME);
         HttpCacheStorage storage = new EhcacheHttpCacheStorage(CACHE_MANAGER.getCache(TEST_EHCACHE_NAME));
-        mockBackend = EasyMock.createMock(HttpClient.class);
+        mockBackend = EasyMock.createNiceMock(HttpClient.class);
 
         impl = new CachingHttpClient(mockBackend, new HeapResourceFactory(), storage, params);
     }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java?rev=1395613&r1=1395612&r2=1395613&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
Mon Oct  8 15:26:50 2012
@@ -57,13 +57,13 @@ public class TestMemcachedHttpCacheStora
     @Override
     @Before
     public void setUp() throws Exception {
-        mockMemcachedClient = EasyMock.createMock(MemcachedClientIF.class);
-        mockKeyHashingScheme = EasyMock.createMock(KeyHashingScheme.class);
-        mockMemcachedCacheEntryFactory = EasyMock.createMock(MemcachedCacheEntryFactory.class);
-        mockMemcachedCacheEntry = EasyMock.createMock(MemcachedCacheEntry.class);
-        mockMemcachedCacheEntry2 = EasyMock.createMock(MemcachedCacheEntry.class);
-        mockMemcachedCacheEntry3 = EasyMock.createMock(MemcachedCacheEntry.class);
-        mockMemcachedCacheEntry4 = EasyMock.createMock(MemcachedCacheEntry.class);
+        mockMemcachedClient = EasyMock.createNiceMock(MemcachedClientIF.class);
+        mockKeyHashingScheme = EasyMock.createNiceMock(KeyHashingScheme.class);
+        mockMemcachedCacheEntryFactory = EasyMock.createNiceMock(MemcachedCacheEntryFactory.class);
+        mockMemcachedCacheEntry = EasyMock.createNiceMock(MemcachedCacheEntry.class);
+        mockMemcachedCacheEntry2 = EasyMock.createNiceMock(MemcachedCacheEntry.class);
+        mockMemcachedCacheEntry3 = EasyMock.createNiceMock(MemcachedCacheEntry.class);
+        mockMemcachedCacheEntry4 = EasyMock.createNiceMock(MemcachedCacheEntry.class);
         CacheConfig config = new CacheConfig();
         config.setMaxUpdateRetries(1);
         impl = new MemcachedHttpCacheStorage(mockMemcachedClient, config,



Mime
View raw message