aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-08-29 19:34:12 +0100
committerTobias Thierer <tobiast@google.com>2017-08-29 20:13:34 +0100
commit08635e6d2d36ffb159488392415128c54fc8eb59 (patch)
treea2e7d54bbbaa298975c3e28c04c247247f383a55 /android
parentf3436b166e01056d7b66abaad5b2e553338e0e3b (diff)
downloadplatform_external_okhttp-08635e6d2d36ffb159488392415128c54fc8eb59.tar.gz
platform_external_okhttp-08635e6d2d36ffb159488392415128c54fc8eb59.tar.bz2
platform_external_okhttp-08635e6d2d36ffb159488392415128c54fc8eb59.zip
Fix ConfigAwareConnectionPoolTest
This test was broken by [1] which moved ConfigAwareConnectionPool and its test to the package libcore.net.http, which also exists in libcore and is not touched by the jarjar rules for the okhttp build. Because the CtsLibcoreOkHttpTestCases tests bundle okhttp code with the test, this meant that there were two copies of libcore.net.http.ConfigAwareConnectionPool in the test's classpath: A jarjar'ed one from the platform, and one from the nojarjar test target. The former was loaded by default, but its get() method returns a com.android.okhttp.ConnectionPool rather than the com.squareup.okhttp.ConnectionPool that the test expected, leading to a NoSuchMethodError at test runtime. This CL fixes the test by moving ConfigAwareConnectionPool{,Test} back into the original okhttp package; note that nothing outside external/okhttp imports ConfigAwareConnectionPool. Had we wanted to keep ConfigAwareConnectionPool separate from com.squareup.okhttp (e.g. if frameworks classes imported it), we could also have moved the class to some other package but add a jarjar rule to move it back to libcore.net.http. Since ConfigAwareConnectionPool is not imported outside of OkHttp code, this CL didn't do that. [1] https://r.android.com/370672/ commit fd27541d8b1efc65c64bd841722830162406d54e Test: CtsLibcoreOkHttpTestCases Test: CtsLibcoreTestCases Bug: 65152821 Change-Id: I90d5a14cb91f9d9c050cf4cf38f90ff93f1591ea
Diffstat (limited to 'android')
-rw-r--r--android/main/java/com/squareup/okhttp/ConfigAwareConnectionPool.java (renamed from android/main/java/libcore/net/http/ConfigAwareConnectionPool.java)4
-rw-r--r--android/main/java/libcore/net/http/HttpHandler.java1
-rw-r--r--android/main/java/libcore/net/http/HttpsHandler.java1
-rw-r--r--android/test/java/com/squareup/okhttp/ConfigAwareConnectionPoolTest.java (renamed from android/test/java/libcore/net/http/ConfigAwareConnectionPoolTest.java)4
4 files changed, 4 insertions, 6 deletions
diff --git a/android/main/java/libcore/net/http/ConfigAwareConnectionPool.java b/android/main/java/com/squareup/okhttp/ConfigAwareConnectionPool.java
index a50c0d0..36c3101 100644
--- a/android/main/java/libcore/net/http/ConfigAwareConnectionPool.java
+++ b/android/main/java/com/squareup/okhttp/ConfigAwareConnectionPool.java
@@ -15,9 +15,7 @@
* limitations under the License.
*/
-package libcore.net.http;
-
-import com.squareup.okhttp.ConnectionPool;
+package com.squareup.okhttp;
import libcore.net.event.NetworkEventDispatcher;
import libcore.net.event.NetworkEventListener;
diff --git a/android/main/java/libcore/net/http/HttpHandler.java b/android/main/java/libcore/net/http/HttpHandler.java
index 4c9a9a8..cf351ad 100644
--- a/android/main/java/libcore/net/http/HttpHandler.java
+++ b/android/main/java/libcore/net/http/HttpHandler.java
@@ -22,6 +22,7 @@ import com.squareup.okhttp.ConnectionSpec;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactories;
import com.squareup.okhttp.OkUrlFactory;
+import com.squareup.okhttp.ConfigAwareConnectionPool;
import com.squareup.okhttp.internal.URLFilter;
import libcore.net.NetworkSecurityPolicy;
import java.io.IOException;
diff --git a/android/main/java/libcore/net/http/HttpsHandler.java b/android/main/java/libcore/net/http/HttpsHandler.java
index 3dd870e..c50611c 100644
--- a/android/main/java/libcore/net/http/HttpsHandler.java
+++ b/android/main/java/libcore/net/http/HttpsHandler.java
@@ -24,6 +24,7 @@ import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactories;
import com.squareup.okhttp.OkUrlFactory;
import com.squareup.okhttp.Protocol;
+import com.squareup.okhttp.ConfigAwareConnectionPool;
import java.net.Proxy;
import java.util.Collections;
diff --git a/android/test/java/libcore/net/http/ConfigAwareConnectionPoolTest.java b/android/test/java/com/squareup/okhttp/ConfigAwareConnectionPoolTest.java
index 73bfd98..825f980 100644
--- a/android/test/java/libcore/net/http/ConfigAwareConnectionPoolTest.java
+++ b/android/test/java/com/squareup/okhttp/ConfigAwareConnectionPoolTest.java
@@ -15,9 +15,7 @@
* limitations under the License.
*/
-package libcore.net.http;
-
-import com.squareup.okhttp.ConnectionPool;
+package com.squareup.okhttp;
import org.junit.Test;