hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1406884 - in /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http: client/utils/ conn/ impl/client/ impl/conn/
Date Thu, 08 Nov 2012 01:32:47 GMT
Author: sebb
Date: Thu Nov  8 01:32:46 2012
New Revision: 1406884

URL: http://svn.apache.org/viewvc?rev=1406884&view=rev
Log:
Fix some obvious boxing in test classes

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java?rev=1406884&r1=1406883&r2=1406884&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java
Thu Nov  8 01:32:46 2012
@@ -56,7 +56,7 @@ public class TestHttpClientUtils {
         HttpResponse response = Mockito.mock(HttpResponse.class);
         HttpEntity entity = Mockito.mock(HttpEntity.class);
         Mockito.when(response.getEntity()).thenReturn(entity);
-        Mockito.when(entity.isStreaming()).thenReturn(false);
+        Mockito.when(entity.isStreaming()).thenReturn(Boolean.FALSE);
         HttpClientUtils.closeQuietly(response);
         Mockito.verify(entity, Mockito.never()).getContent();
     }
@@ -67,7 +67,7 @@ public class TestHttpClientUtils {
         HttpEntity entity = Mockito.mock(HttpEntity.class);
         InputStream instream = Mockito.mock(InputStream.class);
         Mockito.when(response.getEntity()).thenReturn(entity);
-        Mockito.when(entity.isStreaming()).thenReturn(true);
+        Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE);
         Mockito.when(entity.getContent()).thenReturn(instream);
         HttpClientUtils.closeQuietly(response);
         Mockito.verify(instream).close();
@@ -103,7 +103,7 @@ public class TestHttpClientUtils {
         CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
         HttpEntity entity = Mockito.mock(HttpEntity.class);
         Mockito.when(response.getEntity()).thenReturn(entity);
-        Mockito.when(entity.isStreaming()).thenReturn(false);
+        Mockito.when(entity.isStreaming()).thenReturn(Boolean.FALSE);
         HttpClientUtils.closeQuietly(response);
         Mockito.verify(entity, Mockito.never()).getContent();
         Mockito.verify(response).close();
@@ -115,7 +115,7 @@ public class TestHttpClientUtils {
         HttpEntity entity = Mockito.mock(HttpEntity.class);
         InputStream instream = Mockito.mock(InputStream.class);
         Mockito.when(response.getEntity()).thenReturn(entity);
-        Mockito.when(entity.isStreaming()).thenReturn(true);
+        Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE);
         Mockito.when(entity.getContent()).thenReturn(instream);
         HttpClientUtils.closeQuietly(response);
         Mockito.verify(instream).close();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java?rev=1406884&r1=1406883&r2=1406884&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestEofSensorInputStream.java
Thu Nov  8 01:32:46 2012
@@ -49,7 +49,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testClose() throws Exception {
-        Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
 
         eofstream.close();
 
@@ -79,7 +79,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testReleaseConnection() throws Exception {
-        Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.streamClosed(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
 
         eofstream.releaseConnection();
 
@@ -94,7 +94,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testAbortConnection() throws Exception {
-        Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
 
         eofstream.abortConnection();
 
@@ -124,7 +124,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testRead() throws Exception {
-        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
         Mockito.when(instream.read()).thenReturn(0, -1);
 
         Assert.assertEquals(0, eofstream.read());
@@ -147,7 +147,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testReadIOError() throws Exception {
-        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
         Mockito.when(instream.read()).thenThrow(new IOException());
 
         try {
@@ -163,7 +163,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testReadByteArray() throws Exception {
-        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
         Mockito.when(instream.read(Mockito.<byte []>any(), Mockito.anyInt(), Mockito.anyInt()))
             .thenReturn(1, -1);
 
@@ -189,7 +189,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testReadByteArrayIOError() throws Exception {
-        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.eofDetected(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
         Mockito.when(instream.read(Mockito.<byte []>any(), Mockito.anyInt(), Mockito.anyInt()))
             .thenThrow(new IOException());
 
@@ -207,7 +207,7 @@ public class TestEofSensorInputStream {
 
     @Test
     public void testReadAfterAbort() throws Exception {
-        Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(true);
+        Mockito.when(eofwatcher.streamAbort(Mockito.<InputStream>any())).thenReturn(Boolean.TRUE);
 
         eofstream.abortConnection();
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java?rev=1406884&r1=1406883&r2=1406884&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestHttpAuthenticator.java
Thu Nov  8 01:32:46 2012
@@ -84,7 +84,7 @@ public class TestHttpAuthenticator {
         this.authState = new AuthState();
         this.authScheme = Mockito.mock(ContextAwareAuthScheme.class);
         Mockito.when(this.authScheme.getSchemeName()).thenReturn("Basic");
-        Mockito.when(this.authScheme.isComplete()).thenReturn(true);
+        Mockito.when(this.authScheme.isComplete()).thenReturn(Boolean.TRUE);
         this.context = new BasicHttpContext();
         this.host = new HttpHost("localhost", 80);
         this.proxy = new HttpHost("localhost", 8888);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java?rev=1406884&r1=1406883&r2=1406884&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestHttpClientConnectionManagerBase.java
Thu Nov  8 01:32:46 2012
@@ -97,7 +97,7 @@ public class TestHttpClientConnectionMan
         CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
                 -1, TimeUnit.MILLISECONDS);
 
-        Mockito.when(future.isCancelled()).thenReturn(false);
+        Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
         Mockito.when(pool.lease(route, null, null)).thenReturn(future);
 
@@ -120,7 +120,7 @@ public class TestHttpClientConnectionMan
         CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
                 -1, TimeUnit.MILLISECONDS);
 
-        Mockito.when(future.isCancelled()).thenReturn(true);
+        Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
         Mockito.when(pool.lease(route, null, null)).thenReturn(future);
 
@@ -133,7 +133,7 @@ public class TestHttpClientConnectionMan
         HttpHost target = new HttpHost("localhost");
         HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(future.isCancelled()).thenReturn(true);
+        Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenThrow(new TimeoutException());
         Mockito.when(pool.lease(route, null, null)).thenReturn(future);
 
@@ -149,10 +149,10 @@ public class TestHttpClientConnectionMan
         CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id",
route, conn,
                 -1, TimeUnit.MILLISECONDS));
 
-        Mockito.when(future.isCancelled()).thenReturn(false);
+        Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
         Mockito.when(pool.lease(route, null, null)).thenReturn(future);
-        Mockito.when(conn.isOpen()).thenReturn(true);
+        Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE);
 
         ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
         HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS);
@@ -174,10 +174,10 @@ public class TestHttpClientConnectionMan
         CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id",
route, conn,
                 -1, TimeUnit.MILLISECONDS));
 
-        Mockito.when(future.isCancelled()).thenReturn(false);
+        Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
         Mockito.when(pool.lease(route, null, null)).thenReturn(future);
-        Mockito.when(conn.isOpen()).thenReturn(false);
+        Mockito.when(conn.isOpen()).thenReturn(Boolean.FALSE);
 
         ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
         HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS);



Mime
View raw message