hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1698029 [1/2] - in /httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http: impl/nio/ impl/nio/codecs/ impl/nio/pool/ nio/pool/ nio/protocol/
Date Wed, 26 Aug 2015 22:26:19 GMT
Author: ggregory
Date: Wed Aug 26 22:26:18 2015
New Revision: 1698029

URL: http://svn.apache.org/r1698029
Log:
Static methods should be accessed directly.

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestChunkEncoder.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityEncoder.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedEncoder.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/pool/TestBasicNIOConnPool.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncClientExchangeHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncService.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpClientConnection.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpClientConnection.java Wed Aug 26 22:26:18 2015
@@ -183,7 +183,7 @@ public class TestDefaultNHttpClientConne
         Assert.assertTrue(conn.outbuf.hasData());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -210,7 +210,7 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(39, conn.outbuf.length());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -234,10 +234,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -261,10 +261,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -289,10 +289,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -317,10 +317,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -347,10 +347,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -378,10 +378,10 @@ public class TestDefaultNHttpClientConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new RequestReadyAnswer(request)).when(
-            handler).requestReady(Mockito.<NHttpClientConnection>any());
+            handler).requestReady(Matchers.<NHttpClientConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -416,9 +416,9 @@ public class TestDefaultNHttpClientConne
         Mockito.verify(session, Mockito.times(1)).close();
         Mockito.verify(session, Mockito.never()).clearEvent(SelectionKey.OP_WRITE);
         Mockito.verify(handler, Mockito.never()).requestReady(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).outputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<ContentEncoder>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<ContentEncoder>any());
     }
 
     static class ResponseCapturingAnswer implements Answer<Void> {
@@ -475,9 +475,9 @@ public class TestDefaultNHttpClientConne
         final LinkedList<HttpResponse> responses = new LinkedList<>();
 
         Mockito.doAnswer(new ResponseCapturingAnswer(responses)).when(
-            handler).responseReceived(Mockito.<NHttpClientConnection>any());
+            handler).responseReceived(Matchers.<NHttpClientConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
@@ -489,12 +489,12 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(43, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.times(1)).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.times(1)).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
@@ -520,9 +520,9 @@ public class TestDefaultNHttpClientConne
         final LinkedList<HttpResponse> responses = new LinkedList<>();
 
         Mockito.doAnswer(new ResponseCapturingAnswer(responses)).when(
-            handler).responseReceived(Mockito.<NHttpClientConnection>any());
+            handler).responseReceived(Matchers.<NHttpClientConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
@@ -534,12 +534,12 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(54, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.times(1)).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.times(1)).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
@@ -556,9 +556,9 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
         Assert.assertEquals(54, conn.getMetrics().getReceivedBytesCount());
 
-        Mockito.verify(rchannel, Mockito.times(3)).read(Mockito.<ByteBuffer>any());
+        Mockito.verify(rchannel, Mockito.times(3)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
     }
 
     @Test
@@ -572,9 +572,9 @@ public class TestDefaultNHttpClientConne
         final LinkedList<HttpResponse> responses = new LinkedList<>();
 
         Mockito.doAnswer(new ResponseCapturingAnswer(responses)).when(
-            handler).responseReceived(Mockito.<NHttpClientConnection>any());
+            handler).responseReceived(Matchers.<NHttpClientConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentDecoder>any());
 
         conn.consumeInput(handler);
 
@@ -582,12 +582,12 @@ public class TestDefaultNHttpClientConne
         Assert.assertNull(conn.contentDecoder);
 
         Mockito.verify(handler, Mockito.times(1)).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(1)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(1)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
@@ -610,9 +610,9 @@ public class TestDefaultNHttpClientConne
         final LinkedList<HttpResponse> responses = new LinkedList<>();
 
         Mockito.doAnswer(new ResponseCapturingAnswer(responses)).when(
-            handler).responseReceived(Mockito.<NHttpClientConnection>any());
+            handler).responseReceived(Matchers.<NHttpClientConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpClientConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpClientConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
@@ -624,12 +624,12 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(1)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(1)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
         conn.consumeInput(handler);
 
@@ -639,12 +639,12 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
         conn.consumeInput(handler);
         Assert.assertNull(conn.getHttpResponse());
@@ -653,14 +653,14 @@ public class TestDefaultNHttpClientConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).responseReceived(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpClientConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(3)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(3)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.times(1)).endOfInput(
-            Mockito.<NHttpClientConnection>any());
+            Matchers.<NHttpClientConnection>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpClientConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpClientConnection>any(), Matchers.<Exception>any());
 
     }
 
@@ -675,7 +675,7 @@ public class TestDefaultNHttpClientConne
 
         conn.close();
         conn.consumeInput(handler);
-        Mockito.verify(rchannel, Mockito.never()).read(Mockito.<ByteBuffer>any());
+        Mockito.verify(rchannel, Mockito.never()).read(Matchers.<ByteBuffer>any());
         Mockito.verify(session, Mockito.times(1)).clearEvent(SelectionKey.OP_READ);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpServerConnection.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/TestDefaultNHttpServerConnection.java Wed Aug 26 22:26:18 2015
@@ -179,7 +179,7 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(19, conn.outbuf.length());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -204,7 +204,7 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(19, conn.outbuf.length());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -226,10 +226,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -251,10 +251,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -276,10 +276,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -304,10 +304,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -334,10 +334,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -364,10 +364,10 @@ public class TestDefaultNHttpServerConne
         Mockito.when(session.channel()).thenReturn(channel);
 
         Mockito.doAnswer(new ResponseReadyAnswer(response)).when(
-            handler).responseReady(Mockito.<NHttpServerConnection>any());
+            handler).responseReady(Matchers.<NHttpServerConnection>any());
 
         Mockito.doAnswer(new ProduceContentAnswer(entity)).when(
-            handler).outputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            handler).outputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
 
         conn.produceOutput(handler);
 
@@ -402,9 +402,9 @@ public class TestDefaultNHttpServerConne
         Mockito.verify(session, Mockito.times(1)).close();
         Mockito.verify(session, Mockito.never()).clearEvent(SelectionKey.OP_WRITE);
         Mockito.verify(handler, Mockito.never()).responseReady(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).outputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<ContentEncoder>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<ContentEncoder>any());
     }
 
     static class RequestCapturingAnswer implements Answer<Void> {
@@ -461,9 +461,9 @@ public class TestDefaultNHttpServerConne
         final LinkedList<HttpRequest> requests = new LinkedList<>();
 
         Mockito.doAnswer(new RequestCapturingAnswer(requests)).when(
-            handler).requestReceived(Mockito.<NHttpServerConnection>any());
+            handler).requestReceived(Matchers.<NHttpServerConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getRequestCount());
 
@@ -475,12 +475,12 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(43, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.times(1)).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.times(1)).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
@@ -507,9 +507,9 @@ public class TestDefaultNHttpServerConne
         final LinkedList<HttpRequest> requests = new LinkedList<>();
 
         Mockito.doAnswer(new RequestCapturingAnswer(requests)).when(
-            handler).requestReceived(Mockito.<NHttpServerConnection>any());
+            handler).requestReceived(Matchers.<NHttpServerConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
@@ -521,12 +521,12 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(54, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.times(1)).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.times(1)).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
@@ -544,9 +544,9 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
         Assert.assertEquals(54, conn.getMetrics().getReceivedBytesCount());
 
-        Mockito.verify(rchannel, Mockito.times(3)).read(Mockito.<ByteBuffer>any());
+        Mockito.verify(rchannel, Mockito.times(3)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
     }
 
     @Test
@@ -560,9 +560,9 @@ public class TestDefaultNHttpServerConne
         final LinkedList<HttpRequest> requests = new LinkedList<>();
 
         Mockito.doAnswer(new RequestCapturingAnswer(requests)).when(
-            handler).requestReceived(Mockito.<NHttpServerConnection>any());
+            handler).requestReceived(Matchers.<NHttpServerConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentDecoder>any());
 
         conn.consumeInput(handler);
 
@@ -570,12 +570,12 @@ public class TestDefaultNHttpServerConne
         Assert.assertNull(conn.contentDecoder);
 
         Mockito.verify(handler, Mockito.times(1)).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(1)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(1)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
@@ -597,9 +597,9 @@ public class TestDefaultNHttpServerConne
         final LinkedList<HttpRequest> requests = new LinkedList<>();
 
         Mockito.doAnswer(new RequestCapturingAnswer(requests)).when(
-            handler).requestReceived(Mockito.<NHttpServerConnection>any());
+            handler).requestReceived(Matchers.<NHttpServerConnection>any());
         Mockito.doAnswer(new ConsumeContentAnswer(new SimpleInputBuffer(64))).when(
-            handler).inputReady(Mockito.<NHttpServerConnection>any(), Mockito.<ContentDecoder>any());
+            handler).inputReady(Matchers.<NHttpServerConnection>any(), Matchers.<ContentDecoder>any());
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
@@ -611,12 +611,12 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(1)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(1)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
         conn.consumeInput(handler);
 
@@ -626,12 +626,12 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(2)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(2)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
         conn.consumeInput(handler);
         Assert.assertNull(conn.getHttpResponse());
@@ -640,14 +640,14 @@ public class TestDefaultNHttpServerConne
         Assert.assertEquals(0, conn.getMetrics().getReceivedBytesCount());
 
         Mockito.verify(handler, Mockito.never()).requestReceived(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).inputReady(
-            Mockito.<NHttpServerConnection>any(), Mockito.<LengthDelimitedDecoder>any());
-        Mockito.verify(rchannel, Mockito.times(3)).read(Mockito.<ByteBuffer>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<LengthDelimitedDecoder>any());
+        Mockito.verify(rchannel, Mockito.times(3)).read(Matchers.<ByteBuffer>any());
         Mockito.verify(handler, Mockito.times(1)).endOfInput(
-            Mockito.<NHttpServerConnection>any());
+            Matchers.<NHttpServerConnection>any());
         Mockito.verify(handler, Mockito.never()).exception(
-            Mockito.<NHttpServerConnection>any(), Mockito.<Exception>any());
+            Matchers.<NHttpServerConnection>any(), Matchers.<Exception>any());
 
     }
 
@@ -662,7 +662,7 @@ public class TestDefaultNHttpServerConne
 
         conn.close();
         conn.consumeInput(handler);
-        Mockito.verify(rchannel, Mockito.never()).read(Mockito.<ByteBuffer>any());
+        Mockito.verify(rchannel, Mockito.never()).read(Matchers.<ByteBuffer>any());
         Mockito.verify(session, Mockito.times(1)).clearEvent(SelectionKey.OP_READ);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestChunkEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestChunkEncoder.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestChunkEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestChunkEncoder.java Wed Aug 26 22:26:18 2015
@@ -36,6 +36,7 @@ import org.apache.http.impl.nio.reactor.
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.junit.Assert;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 /**
@@ -125,7 +126,7 @@ public class TestChunkEncoder {
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("0123456789ABCDEF")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
 
         outbuf.flush(channel);
         final String s = channel.dump(Consts.ASCII);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityEncoder.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestIdentityEncoder.java Wed Aug 26 22:26:18 2015
@@ -42,6 +42,7 @@ import org.apache.http.util.CharArrayBuf
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 /**
@@ -318,8 +319,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 0);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -342,8 +343,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 32);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -365,8 +366,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -389,8 +390,8 @@ public class TestIdentityEncoder {
         final IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics, 2);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -413,8 +414,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -438,8 +439,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -465,8 +466,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -487,8 +488,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
 
-        Mockito.verify(channel, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -510,8 +511,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -540,8 +541,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(6)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(6)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -565,8 +566,8 @@ public class TestIdentityEncoder {
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedEncoder.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/codecs/TestLengthDelimitedEncoder.java Wed Aug 26 22:26:18 2015
@@ -42,6 +42,7 @@ import org.apache.http.util.CharArrayBuf
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 /**
@@ -377,8 +378,8 @@ public class TestLengthDelimitedEncoder
             100, 0);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -402,8 +403,8 @@ public class TestLengthDelimitedEncoder
             100, 32);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -426,8 +427,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -450,8 +451,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff; and a lot more stuff")));
 
-        Mockito.verify(channel, Mockito.never()).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.never()).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.never()).flush(channel);
 
         Assert.assertEquals(0, metrics.getBytesTransferred());
@@ -475,8 +476,8 @@ public class TestLengthDelimitedEncoder
             100, 2);
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.never()).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.never()).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(13, metrics.getBytesTransferred());
@@ -500,8 +501,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(3)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -526,8 +527,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(18, metrics.getBytesTransferred());
@@ -554,8 +555,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(2, encoder.write(CodecTestUtils.wrap("--")));
         Assert.assertEquals(10, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(4)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(4)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(2)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -577,8 +578,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(6, encoder.write(CodecTestUtils.wrap("-stuff")));
 
-        Mockito.verify(channel, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -601,8 +602,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(5, encoder.write(CodecTestUtils.wrap("stuff")));
         Assert.assertEquals(16, encoder.write(CodecTestUtils.wrap("-much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(2)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(1)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(2)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(1)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(21, metrics.getBytesTransferred());
@@ -632,8 +633,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(0, encoder.write(CodecTestUtils.wrap("more stuff")));
 
-        Mockito.verify(channel, Mockito.times(5)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(6)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(5)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(6)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(4)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());
@@ -658,8 +659,8 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("-")));
         Assert.assertEquals(1, encoder.write(CodecTestUtils.wrap("much more stuff")));
 
-        Mockito.verify(channel, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
-        Mockito.verify(outbuf, Mockito.times(3)).write(Mockito.<ByteBuffer>any());
+        Mockito.verify(channel, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
+        Mockito.verify(outbuf, Mockito.times(3)).write(Matchers.<ByteBuffer>any());
         Mockito.verify(outbuf, Mockito.times(1)).flush(channel);
 
         Assert.assertEquals(8, metrics.getBytesTransferred());

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/pool/TestBasicNIOConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/pool/TestBasicNIOConnPool.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/pool/TestBasicNIOConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/pool/TestBasicNIOConnPool.java Wed Aug 26 22:26:18 2015
@@ -38,6 +38,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -113,10 +114,10 @@ public class TestBasicNIOConnPool {
         Mockito.when(sessionRequest.getSession()).thenReturn(session);
         Mockito.when(sessionRequest.getAttachment()).thenReturn(host);
         Mockito.when(reactor.connect(
-                Mockito.any(SocketAddress.class),
-                Mockito.any(SocketAddress.class),
-                Mockito.eq(host),
-                Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class),
+                Matchers.any(SocketAddress.class),
+                Matchers.eq(host),
+                Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest);
 
         Mockito.when(session.getSocketTimeout()).thenReturn(999);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/pool/TestNIOConnPool.java Wed Aug 26 22:26:18 2015
@@ -46,6 +46,7 @@ import org.apache.http.pool.PoolEntry;
 import org.apache.http.pool.PoolStats;
 import org.junit.Assert;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 public class TestNIOConnPool {
@@ -172,9 +173,9 @@ public class TestNIOConnPool {
         Mockito.when(sessionRequest.getSession()).thenReturn(iosession);
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest);
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
         final Future<LocalPoolEntry> future = pool.lease("somehost", null, 100, TimeUnit.MILLISECONDS, null);
@@ -205,9 +206,9 @@ public class TestNIOConnPool {
         Mockito.when(sessionRequest.getException()).thenReturn(new IOException());
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest);
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
         final Future<LocalPoolEntry> future = pool.lease("somehost", null);
@@ -242,9 +243,9 @@ public class TestNIOConnPool {
         Mockito.when(sessionRequest.getSession()).thenReturn(iosession);
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest);
         Mockito.when(ioreactor.getStatus()).thenReturn(IOReactorStatus.ACTIVE);
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
@@ -276,9 +277,9 @@ public class TestNIOConnPool {
         Mockito.when(sessionRequest.getSession()).thenReturn(iosession);
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest);
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
         final Future<LocalPoolEntry> future = pool.lease("somehost", null);
@@ -341,14 +342,14 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest2);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
@@ -415,14 +416,14 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest2);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
@@ -474,8 +475,8 @@ public class TestNIOConnPool {
         Assert.assertFalse(future9.isDone());
 
         Mockito.verify(ioreactor, Mockito.times(3)).connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.release(entry4, true);
         pool.release(entry5, false);
@@ -486,8 +487,8 @@ public class TestNIOConnPool {
         Assert.assertTrue(future9.isDone());
 
         Mockito.verify(ioreactor, Mockito.times(4)).connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
     }
 
     @Test
@@ -514,14 +515,14 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1, sessionRequest2, sessionRequest1);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest3, sessionRequest4, sessionRequest3);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
@@ -535,14 +536,14 @@ public class TestNIOConnPool {
         final Future<LocalPoolEntry> future4 = pool.lease("otherhost", null);
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(ioreactor, Mockito.never()).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.requestCompleted(sessionRequest1);
         pool.requestCompleted(sessionRequest2);
@@ -566,14 +567,14 @@ public class TestNIOConnPool {
         pool.release(entry2, true);
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.requestCompleted(sessionRequest3);
         pool.requestCompleted(sessionRequest4);
@@ -594,27 +595,27 @@ public class TestNIOConnPool {
         final Future<LocalPoolEntry> future6 = pool.lease("otherhost", null);
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.release(entry3, true);
         pool.release(entry4, true);
 
         Mockito.verify(ioreactor, Mockito.times(3)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.requestCompleted(sessionRequest1);
 
@@ -634,14 +635,14 @@ public class TestNIOConnPool {
         pool.release(entry6, true);
 
         Mockito.verify(ioreactor, Mockito.times(3)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("otherhost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         totals = pool.getTotalStats();
         Assert.assertEquals(2, totals.getAvailable());
@@ -668,9 +669,9 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1, sessionRequest2, sessionRequest3);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 10);
@@ -681,9 +682,9 @@ public class TestNIOConnPool {
         final Future<LocalPoolEntry> future2 = pool.lease("somehost", null);
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.requestCompleted(sessionRequest1);
         pool.requestCompleted(sessionRequest2);
@@ -716,9 +717,9 @@ public class TestNIOConnPool {
         Assert.assertNotNull(entry4);
 
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.release(entry3, true);
         pool.release(entry4, true);
@@ -733,9 +734,9 @@ public class TestNIOConnPool {
         Assert.assertFalse(future5.isDone());
 
         Mockito.verify(ioreactor, Mockito.times(3)).connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         Mockito.verify(iosession2).close();
         Mockito.verify(iosession1, Mockito.never()).close();
@@ -756,9 +757,9 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.eq(InetSocketAddress.createUnresolved("somehost", 80)),
-                Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.eq(InetSocketAddress.createUnresolved("somehost", 80)),
+                Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 2);
@@ -766,8 +767,8 @@ public class TestNIOConnPool {
         final Future<LocalPoolEntry> future1 = pool.lease("somehost", null);
 
         Mockito.verify(ioreactor, Mockito.times(1)).connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         pool.requestCompleted(sessionRequest1);
 
@@ -786,8 +787,8 @@ public class TestNIOConnPool {
 
         Mockito.verify(iosession1).close();
         Mockito.verify(ioreactor, Mockito.times(2)).connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class));
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class));
 
         final PoolStats totals = pool.getTotalStats();
         Assert.assertEquals(0, totals.getAvailable());
@@ -815,8 +816,8 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1, sessionRequest2);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 2);
@@ -871,8 +872,8 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1, sessionRequest2);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 2, 2);
@@ -936,8 +937,8 @@ public class TestNIOConnPool {
 
         final ConnectingIOReactor ioreactor = Mockito.mock(ConnectingIOReactor.class);
         Mockito.when(ioreactor.connect(
-                Mockito.any(SocketAddress.class), Mockito.any(SocketAddress.class),
-                Mockito.any(), Mockito.any(SessionRequestCallback.class))).
+                Matchers.any(SocketAddress.class), Matchers.any(SocketAddress.class),
+                Matchers.any(), Matchers.any(SessionRequestCallback.class))).
                 thenReturn(sessionRequest1);
 
         final LocalSessionPool pool = new LocalSessionPool(ioreactor, 1, 1);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncClientExchangeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncClientExchangeHandler.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncClientExchangeHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncClientExchangeHandler.java Wed Aug 26 22:26:18 2015
@@ -46,6 +46,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 public class TestBasicAsyncClientExchangeHandler {
@@ -344,7 +345,7 @@ public class TestBasicAsyncClientExchang
     @Test
     public void testInputTerminated() throws Exception {
         this.exchangeHandler.inputTerminated();
-        Mockito.verify(this.responseConsumer).failed(Mockito.<ConnectionClosedException>any());
+        Mockito.verify(this.responseConsumer).failed(Matchers.<ConnectionClosedException>any());
         try {
             this.exchangeHandler.getFuture().get();
             Assert.fail("ExecutionException expected");

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java Wed Aug 26 22:26:18 2015
@@ -38,6 +38,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 public class TestBasicAsyncRequestHandler {
@@ -89,7 +90,7 @@ public class TestBasicAsyncRequestHandle
         this.asyncRequestHandler.handle(this.request, this.httpexchange, this.context);
 
         Mockito.verify(this.requestHandler).handle(
-                Mockito.eq(this.request), Mockito.eq(this.response), Mockito.eq(this.context));
+                Matchers.eq(this.request), Matchers.eq(this.response), Matchers.eq(this.context));
         Mockito.verify(this.httpexchange).submitResponse();
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequestExecutor.java Wed Aug 26 22:26:18 2015
@@ -52,6 +52,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 public class TestHttpAsyncRequestExecutor {
@@ -130,7 +131,7 @@ public class TestHttpAsyncRequestExecuto
 
         this.protocolHandler.closed(this.conn);
 
-        Mockito.verify(this.exchangeHandler).failed(Mockito.any(ConnectionClosedException.class));
+        Mockito.verify(this.exchangeHandler).failed(Matchers.any(ConnectionClosedException.class));
     }
 
     @Test
@@ -193,7 +194,7 @@ public class TestHttpAsyncRequestExecuto
         Mockito.verify(this.exchangeHandler).generateRequest();
         Assert.assertNull(state.getRequest());
 
-        Mockito.verify(this.conn, Mockito.never()).submitRequest(Mockito.<HttpRequest>any());
+        Mockito.verify(this.conn, Mockito.never()).submitRequest(Matchers.<HttpRequest>any());
     }
 
     @Test
@@ -602,7 +603,7 @@ public class TestHttpAsyncRequestExecuto
         Assert.assertFalse(state.isValid());
 
         Mockito.verify(this.conn).close();
-        Mockito.verify(this.exchangeHandler).failed(Mockito.any(ConnectionClosedException.class));
+        Mockito.verify(this.exchangeHandler).failed(Matchers.any(ConnectionClosedException.class));
     }
 
     @Test
@@ -661,10 +662,10 @@ public class TestHttpAsyncRequestExecuto
 
         Assert.assertEquals(MessageState.BODY_STREAM, state.getRequestState());
         Assert.assertFalse(state.isValid());
-        Mockito.verify(this.exchangeHandler).failed(Mockito.any(SocketTimeoutException.class));
+        Mockito.verify(this.exchangeHandler).failed(Matchers.any(SocketTimeoutException.class));
         Mockito.verify(this.exchangeHandler).close();
         Mockito.verify(this.conn).close();
-        Mockito.verify(this.conn, Mockito.never()).setSocketTimeout(Mockito.anyInt());
+        Mockito.verify(this.conn, Mockito.never()).setSocketTimeout(Matchers.anyInt());
     }
 
     @Test
@@ -679,7 +680,7 @@ public class TestHttpAsyncRequestExecuto
 
         Assert.assertEquals(MessageState.BODY_STREAM, state.getRequestState());
         Assert.assertFalse(state.isValid());
-        Mockito.verify(this.exchangeHandler).failed(Mockito.any(SocketTimeoutException.class));
+        Mockito.verify(this.exchangeHandler).failed(Matchers.any(SocketTimeoutException.class));
         Mockito.verify(this.exchangeHandler).close();
         Mockito.verify(this.conn).close();
         Mockito.verify(this.conn).setSocketTimeout(250);
@@ -697,7 +698,7 @@ public class TestHttpAsyncRequestExecuto
 
         Assert.assertEquals(MessageState.BODY_STREAM, state.getRequestState());
         Assert.assertFalse(state.isValid());
-        Mockito.verify(this.exchangeHandler).failed(Mockito.any(SocketTimeoutException.class));
+        Mockito.verify(this.exchangeHandler).failed(Matchers.any(SocketTimeoutException.class));
         Mockito.verify(this.exchangeHandler).close();
         Mockito.verify(this.conn).shutdown();
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java?rev=1698029&r1=1698028&r2=1698029&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncRequester.java Wed Aug 26 22:26:18 2015
@@ -47,6 +47,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 public class TestHttpAsyncRequester {
@@ -174,8 +175,8 @@ public class TestHttpAsyncRequester {
                 this.responseConsumer,
                 this.conn, this.exchangeContext, null);
         Assert.assertNotNull(future);
-        Mockito.verify(this.requestProducer).failed(Mockito.any(ConnectionClosedException.class));
-        Mockito.verify(this.responseConsumer).failed(Mockito.any(ConnectionClosedException.class));
+        Mockito.verify(this.requestProducer).failed(Matchers.any(ConnectionClosedException.class));
+        Mockito.verify(this.responseConsumer).failed(Matchers.any(ConnectionClosedException.class));
         Mockito.verify(this.requestProducer, Mockito.atLeastOnce()).close();
         Mockito.verify(this.responseConsumer, Mockito.atLeastOnce()).close();
         Assert.assertTrue(future.isDone());
@@ -203,7 +204,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         final Exception oppsie = new Exception();
@@ -227,7 +228,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         connRequestCallback.cancelled();
@@ -250,7 +251,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         future.cancel(true);
@@ -275,7 +276,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         final BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
@@ -308,7 +309,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         final BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);
@@ -341,7 +342,7 @@ public class TestHttpAsyncRequester {
         Assert.assertNotNull(future);
         final ArgumentCaptor<FutureCallback> argCaptor = ArgumentCaptor.forClass(FutureCallback.class);
         Mockito.verify(this.connPool).lease(
-                Mockito.eq(host), Mockito.isNull(), argCaptor.capture());
+                Matchers.eq(host), Matchers.isNull(), argCaptor.capture());
         final ConnRequestCallback connRequestCallback = (ConnRequestCallback) argCaptor.getValue();
 
         final BasicNIOPoolEntry entry = new BasicNIOPoolEntry("id", host, this.conn);



Mime
View raw message