hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1767391 [2/2] - in /httpcomponents/httpclient/trunk: ./ httpclient5-cache/ httpclient5-cache/src/test/resources/ httpclient5-fluent/ httpclient5-fluent/src/test/resources/ httpclient5-osgi/ httpclient5-osgi/src/main/java/org/apache/hc/clie...
Date Mon, 31 Oct 2016 23:24:38 GMT
Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java?rev=1767391&r1=1767390&r2=1767391&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
Mon Oct 31 23:24:37 2016
@@ -34,7 +34,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import org.apache.commons.logging.LogFactory;
 import org.apache.hc.client5.http.ConnectionPoolTimeoutException;
 import org.apache.hc.client5.http.DnsResolver;
 import org.apache.hc.client5.http.HttpRoute;
@@ -50,6 +49,7 @@ import org.apache.hc.core5.http.config.L
 import org.apache.hc.core5.http.config.SocketConfig;
 import org.apache.hc.core5.http.io.HttpClientConnection;
 import org.apache.hc.core5.http.protocol.HttpContext;
+import org.apache.logging.log4j.LogManager;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -95,7 +95,7 @@ public class TestPoolingHttpClientConnec
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route,
conn,
+        final CPoolEntry entry = new CPoolEntry(LogManager.getLogger(getClass()), "id", route,
conn,
                 -1, TimeUnit.MILLISECONDS);
         entry.markRouteComplete();
 
@@ -124,7 +124,7 @@ public class TestPoolingHttpClientConnec
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route,
conn,
+        final CPoolEntry entry = new CPoolEntry(LogManager.getLogger(getClass()), "id", route,
conn,
                 -1, TimeUnit.MILLISECONDS);
 
         Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
@@ -152,7 +152,7 @@ public class TestPoolingHttpClientConnec
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route,
conn,
+        final CPoolEntry entry = new CPoolEntry(LogManager.getLogger(getClass()), "id", route,
conn,
                 -1, TimeUnit.MILLISECONDS);
         entry.markRouteComplete();
 
@@ -182,7 +182,7 @@ public class TestPoolingHttpClientConnec
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()),
"id", route, conn,
+        final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogManager.getLogger(getClass()),
"id", route, conn,
                 -1, TimeUnit.MILLISECONDS));
         entry.markRouteComplete();
 
@@ -208,7 +208,7 @@ public class TestPoolingHttpClientConnec
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()),
"id", route, conn,
+        final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogManager.getLogger(getClass()),
"id", route, conn,
                 -1, TimeUnit.MILLISECONDS));
         entry.markRouteComplete();
 
@@ -236,7 +236,7 @@ public class TestPoolingHttpClientConnec
         final InetAddress local = InetAddress.getByAddress(new byte[]{127, 0, 0, 1});
         final HttpRoute route = new HttpRoute(target, local, true);
 
-        final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route,
conn,
+        final CPoolEntry entry = new CPoolEntry(LogManager.getLogger(getClass()), "id", route,
conn,
                 -1, TimeUnit.MILLISECONDS);
         entry.markRouteComplete();
         Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
@@ -286,7 +286,7 @@ public class TestPoolingHttpClientConnec
         final InetAddress local = InetAddress.getByAddress(new byte[] {127, 0, 0, 1});
         final HttpRoute route = new HttpRoute(target, local, proxy, true);
 
-        final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route,
conn,
+        final CPoolEntry entry = new CPoolEntry(LogManager.getLogger(getClass()), "id", route,
conn,
                 -1, TimeUnit.MILLISECONDS);
         entry.markRouteComplete();
         Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/sync/TestConnectionHolder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/sync/TestConnectionHolder.java?rev=1767391&r1=1767390&r2=1767391&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/sync/TestConnectionHolder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/sync/TestConnectionHolder.java
Mon Oct 31 23:24:37 2016
@@ -29,9 +29,9 @@ package org.apache.hc.client5.http.impl.
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.commons.logging.Log;
 import org.apache.hc.client5.http.io.HttpClientConnectionManager;
 import org.apache.hc.core5.http.io.HttpClientConnection;
+import org.apache.logging.log4j.Logger;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -40,14 +40,14 @@ import org.mockito.Mockito;
 @SuppressWarnings({"static-access"}) // test code
 public class TestConnectionHolder {
 
-    private Log log;
+    private Logger log;
     private HttpClientConnectionManager mgr;
     private HttpClientConnection conn;
     private ConnectionHolder connHolder;
 
     @Before
     public void setup() {
-        log = Mockito.mock(Log.class);
+        log = Mockito.mock(Logger.class);
         mgr = Mockito.mock(HttpClientConnectionManager.class);
         conn = Mockito.mock(HttpClientConnection.class);
         connHolder = new ConnectionHolder(log, mgr, conn);

Added: httpcomponents/httpclient/trunk/httpclient5/src/test/resources/log4j2.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/resources/log4j2.xml?rev=1767391&view=auto
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/resources/log4j2.xml (added)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/resources/log4j2.xml Mon Oct 31 23:24:37
2016
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<Configuration status="WARN" name="XMLConfigTest">
+  <Appenders>
+    <Console name="STDOUT">
+      <PatternLayout pattern="%d %-5level [%t][%logger]%notEmpty{[%markerSimpleName]}
%msg%n%xThrowable" />
+    </Console>
+  </Appenders>
+  <Loggers>
+    <Root level="WARN">
+      <AppenderRef ref="STDOUT" />
+    </Root>
+  </Loggers>
+</Configuration>
\ No newline at end of file

Modified: httpcomponents/httpclient/trunk/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/pom.xml?rev=1767391&r1=1767390&r2=1767391&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/pom.xml (original)
+++ httpcomponents/httpclient/trunk/pom.xml Mon Oct 31 23:24:37 2016
@@ -68,7 +68,7 @@
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>
     <httpcore.version>5.0-alpha1</httpcore.version>
-    <commons-logging.version>1.2</commons-logging.version>
+    <log4j.version>2.7</log4j.version>
     <commons-codec.version>1.10</commons-codec.version>
     <ehcache.version>2.6.11</ehcache.version>
     <memcached.version>2.12.0</memcached.version>
@@ -89,9 +89,15 @@
         <version>${httpcore.version}</version>
       </dependency>
       <dependency>
-        <groupId>commons-logging</groupId>
-        <artifactId>commons-logging</artifactId>
-        <version>${commons-logging.version}</version>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-core</artifactId>
+        <version>${log4j.version}</version>
+        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>commons-codec</groupId>



Mime
View raw message