1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-24 18:41:06 +03:00
Commit Graph

35 Commits

Author SHA1 Message Date
Yuri Schimke
7cf508a30b OpenJSSE Platform support (#5369)
Adds support for OpenJSSE when registered as the first security provider.
2019-08-18 12:03:51 +03:00
Yuri Schimke
1b60e3739c Test Android session reuse 2019-08-11 10:48:43 +01:00
Yuri Schimke
2a1f328d58 Add proxy event logging (#5300) 2019-07-25 05:42:32 +01:00
Yuri Schimke
2c7811a64a Move flaky issues to comments (#5289) 2019-07-16 22:50:51 +01:00
Yuri Schimke
a6c4ff6e44 Output client events after tagged @Flaky tests or failures (#5217)
Collect additional debugging info for know problem tests or after unplanned failures.
2019-07-16 22:34:32 +01:00
Yuri Schimke
16b7e36968 Fix for conscrypt tests (#5263) 2019-07-03 07:20:28 +01:00
Yuri Schimke
bdd6c3944f Testing with JDK 12 and latest 11.0.3 (#5212)
JDK 12 and be more specific about when we expect failures, e.g. 11.0.3 has fixes we should take into account.
2019-07-02 07:21:58 +01:00
Yuri Schimke
d81ec0f23b OkHttpClientTestRule check connectionCount instead of idle (#5226)
* OkHttpClientTestRule check connectionCount instead of idle

Clients should be clean after use, not just from idle connections.

* Abandon unclean clients

* Simplify logic
2019-06-25 22:34:51 -07:00
Jesse Wilson
ad5d6b8a7b Make OkHttpClientTestRule more powerful.
I'm hoping to follow this up with a change so that this rule can also do the
uncaught exception handling that we're currently doing elsewhere.

See https://github.com/square/okhttp/issues/4894
2019-06-15 22:08:18 -04:00
Amir Livneh
8deaef6702 Fix race condition in RecordingHostnameVerifier
When connections are established concurrently, verify() sometimes throws a `java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 0` because of unsynchronized access to the `calls` list.
2019-04-23 10:19:22 -07:00
Yuri Schimke
f3949c23bc Spotless code formatter 2019-04-10 22:44:58 +01:00
Yuri Schimke
9e12bc4d60 Improve PlatformRule autodetection (#4920)
Run more platforms in circleci.
Auto detect platform in IDE.
Surface more platform assumptions in tests.
2019-04-10 19:31:35 +01:00
TangHuaiZhe
a7603602ca add @overide for subclass override method 2019-03-30 12:46:18 +08:00
Jesse Wilson
dedc6ecd5b Use more AssertJ features 2019-03-14 17:57:42 -04:00
Benoît Quenaudon
6c4855a7c7 Use AssertJ in tests (#4713) 2019-03-13 21:07:33 -04:00
Amir Livneh
018510fa40 Rename OkHttpClientTestingRule to OkHttpClientTestRule 2019-03-07 07:24:05 -05:00
Amir Livneh
aca6785440 Use a TestRule to check for connection leaks 2019-03-06 06:21:15 -05:00
Amir Livneh
851e37f52a Test for connection leaks in more tests
This will help prevent regressions and point to the leaking test, rather than to a later test that happens to checks for leaks. The change is applied to all tests that have an OkHttpClient member variable.
2019-03-02 16:51:18 -05:00
Jesse Wilson
4bea2830d9 Test that duplex works fine with interceptors 2019-02-26 21:48:28 -05:00
Benoit Quenaudon
c49abad3a2 Introduces isDuplex method to RequestBody 2019-02-26 12:05:56 -05:00
Jesse Wilson
392165d238 Improve testing in MockDuplexResponseBody 2019-02-03 21:56:39 -05:00
Jesse Wilson
8dcfaf02b5 Turn DuplexRequestBody into a marker interface.
And later maybe a simple public method.
2019-01-31 19:42:06 -05:00
Jesse Wilson
778e0334a4 Use lambdas where appropriate 2019-01-11 22:31:36 -05:00
Jesse Wilson
04a74b2df4 Confirm that call timeouts don't apply to SSE or web sockets. 2018-11-06 21:42:34 +11:00
Yuri Schimke
adb2a82049 Dont System.exit the test runner (#3888)
* Dont System.exit

* Maven aware uncaught exception handling

* cleanup
2018-02-25 22:32:03 -05:00
Yuri Schimke
9e0b5b81b0 Make FakeDns more capable. 2017-03-05 16:06:02 -05:00
Dave Roberge
aaa41df1e9 Removed IOException from FileSystem exists method as this should never occur. 2016-02-25 16:53:04 -05:00
jwilson
561613d579 Create request/response API tests to match some URLConnectionTest tests.
This is more work towards being able to later delete HttpURLConnectionImpl
without losing test coverage.

Also do some test cleanup.
2016-01-23 19:12:33 -05:00
jwilson
32fb79996c Change CookieJar to deal with Cookies, not Headers.
There's a big consequence to this for compatible with RFC 2965 Cookies. In particular,
this drops our ability to support 'Set-Cookie2' headers, and some features used there
including quoted attributes like 'Max-Age="25"'. This is the right move for interop with
browsers, and likely to make things better for application developers, but some
people who strictly followed the RFC 2965 spec will be broken. (That spec was never
seriously adopted anywhere, which is the entire motivation of RFC 6265.)

The upside is the CookieJar interface is now much more straightforward. This is
particularly good going forward, and for clients who don't have to worry about the
strangeness of things like $Version=1 in the RFC 2965 spec.
2015-12-30 19:28:13 -05:00
jwilson
98ae0fb92c Sort imports and wrap documentation at 100 columns.
This is a mechanical refactoring. The only thing I had trouble with is IntelliJ's
weak support for <ul> tags in Javadoc.
2015-12-23 19:34:28 -05:00
jwilson
c9a89876de Rename com.squareup.okhttp to okhttp3
Maven group changes will come in follow up.
2015-12-16 01:34:59 -05:00
Jake Wharton
a9015ebe7d Add a strict mode of sorts to InMemoryFileSystem to detect handle leaks. 2015-10-08 02:11:44 -04:00
jwilson
a560f72193 Expose internal APIs for pluggable file systems.
We aren't yet ready to make FileSystem a public type, but I don't mind
making it _almost_ available via an internal API for those brave enough
to try that.

Also migrate all of our tests to use the in memory file system. It's simpler.

https://github.com/square/okhttp/issues/1459
2015-08-01 11:56:40 -07:00
jwilson
805076f68a Accept ws: URLs in Request.Builder.
I contemplated supporting them in HttpUrl, but then realized I'd
either need to document that behavior (which is weird behavior)
or return ws from the scheme (which seems arbitrary.)

Doing it in Request seems less bad: we support websockets requests.
2015-05-18 20:40:48 -04:00
Neil Fuller
4e08085cc8 Install an UncaughtExceptionHandler during tests
This is to make the tests more brittle around uncaught exceptions
as they are on Android. No uncaught exceptions should escape.
2015-04-14 16:55:26 +01:00