History log of /libcore/luni/src/test/java/libcore/java/net/URLConnectionTest.java
Revision Date Author Comments
6c9609af5f63a759bd50b5f6586f6f52502b4f93 07-Oct-2014 Neil Fuller <nfuller@google.com> Add support for TLS_FALLBACK_SCSV

Backport of commits:

external/conscrypt: 8d7e23e117da591a8d48e6bcda9ed6f58ff1a375
libcore: e6a6e935e98f426c7000b2bf4086f87101f4441c
libcore: 957ec8b09833e1c2f2c21380e53c13c9962e6b3e

Plus additional changes to:
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
luni/src/test/java/libcore/java/net/URLConnectionTest.java
luni/src/test/java/org/apache/harmony/xnet/provider/jsse/CipherSuiteTest.java
support/src/test/java/libcore/java/security/StandardNames.java

to account for KitKat differences.

Bug: 17750026
Change-Id: Ic6e9474275bc3ffec3b5c2d6df1f8d6ffe77bff8
865c83f8383f03d545217c35d9140a4627a74406 07-Oct-2014 Neil Fuller <nfuller@google.com> Add support for TLS_FALLBACK_SCSV

Backport of commits:

external/conscrypt: 8d7e23e117da591a8d48e6bcda9ed6f58ff1a375
libcore: e6a6e935e98f426c7000b2bf4086f87101f4441c
libcore: 957ec8b09833e1c2f2c21380e53c13c9962e6b3e

Plus additional changes to:
luni/src/main/java/libcore/net/http/HttpConnection.java
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
luni/src/test/java/libcore/java/net/URLConnectionTest.java
luni/src/test/java/org/apache/harmony/xnet/provider/jsse/CipherSuiteTest.java
support/src/test/java/libcore/java/security/StandardNames.java

to account for JellyBean differences.

Bug: 17750026
Change-Id: I7b60b1260fa0b275631ce9987168c7b5fc7ca138
957ec8b09833e1c2f2c21380e53c13c9962e6b3e 03-Oct-2014 Neil Fuller <nfuller@google.com> Changes to support TLS fallback SCSV

Fixes for tests.

Change-Id: Ie8e01e8fa654afd6b6c9f30ec46552d46326e467
fa023837b8be8e9eda6008398648b4c9b1aa1e3e 28-May-2014 Neil Fuller <nfuller@google.com> Fix for flakiness in URLConnectionTest.testServerShutdownOutput

Flakiness reported by Junjie.Hu <junjie.hu@mediatek.com>
This fix relies on changes to MockWebServer to provide
deterministic ordering of responses.

Change-Id: I4f296fa2f8d227876f52c69e22001f4e0d7b4ffd
a6f350c645dbb66d68cc2b03afb8f2eeaa88fbba 28-Feb-2014 Paul Duffin <paulduffin@google.com> Improve detection of CloseGuard protected resource leakage

* Add CloseGuardMonitor to intercept and collate CloseGuard reports and if
necessary throw an exception listing the resource leaks.
* Add ResourceLeakageDetector to abstract away the CloseGuardMonitor which will
not work on RI.
* Add AbstractResourceLeakageDetectorTestCase as a base class for tests
that need to detect resource leaks, in future this could be handled by
modifications to Cts and Vogar test runners.
* Remove CloseGuardTester and its sole usage in ProcessBuilderTest.
* Remove CloseGuardGuard from within URLConnectionTest
* Change ZipFileTest, ProcessBuilderTest, URLConnectionTest to use new
mechanism, fix issues that are identified and do some cleanup/remove
duplicated code.

Bug: https://code.google.com/p/android/issues/detail?id=66383
Change-Id: Id026dbb6bc66091a15f07329e6371cd0d1f32cf5
ac03ce489cbe22905ee525e005d67df0a74ff8de 06-Mar-2014 Neil Fuller <nfuller@google.com> Relax testUrlWithSpaceInHostViaHttpProxy test

This is for the new OkHttp version. The older
version detected the URL is invalid on Android. The newer
version does not. The correct behavior is undefined and
this test was added to prove that NullPointerException is
not thrown, which it will still test for.

Change-Id: Ibbaaf006982eba9de2d3751c6ee302dd28f7786f
9749b98a92fbf2bfe095b7ec884789f62ab293d8 03-Mar-2014 Neil Fuller <nfuller@google.com> Fix URLConnectionTest#testSetChunkedStreamingMode

Commit 60f79119fd7e37c459a96888594f90d86bab5535 broke it
- until OkHttp is upgraded the chunkLength is obeyed.
The argument needs to be >= 8 for the test to pass.

Change-Id: I22acaa4a56fdbd22abc075a2300cf53e303ec791
60f79119fd7e37c459a96888594f90d86bab5535 27-Feb-2014 Neil Fuller <nfuller@google.com> Tests and docs updates for OkHttp update.

OkHttp has made various changes. This fixes the known
breakages before the update is applied.

1) Chunk length is no longer honored exactly. The
API docs have been updated to reflect this.

2) testConnectViaHttpsWithSSLFallback simulated an SSL
handshake failure by closing the socket. This is no longer
sufficient to trigger the fallback behavior after OkHttp change
46a0852. testSslFallback tests an actual handshake failure and
provides coverage. testConnectViaHttpsWithSSLFallback
has therefore been removed.

3) testRetryableRequestBodyAfterBrokenConnection is similar to
testConnectViaHttpsWithSSLFallback. Previously it passed because
of the SSL fallback behavior. That fallback no longer happens.
It is possible this was actually supposed to be checking the
internal RetryableOutputStream. Now OkHttp does not retry
connections after the connection is made it is not possible
to test the request body is "replayed" to the server.

4) testNonRetryableRequestBodyAfterBrokenConnection: Related to
3 above. It was testing that fixed length request bodies are not
retryable. This test continues to pass with OkHttp but only
because it fails to retry generally, not because of the request
body and therefore the test is misleading.

Change-Id: If430bce75ad5b2fd5ace38d0f65d9c4af56b88df
9de94e4aaa6de951d1c7ca08d137d57b36d24fa3 19-Dec-2013 Alex Klyubin <klyubin@google.com> Fix test breakages due to TLSv1.2 enabled and FS preferred.

Bug: 11220570
Change-Id: Ic918e806ae1d8ea9b98c690cfabd9c3245886525
ec33de3303760e5ba31bd6d0e6b46d5681c123dc 04-Nov-2013 Narayan Kamath <narayan@google.com> Add a test for lower case auth scheme handling.

bug: 11473660

(Cherry picked from d87ee0f7b587bf19b7bf4c047aa6e5ab0c5045de)

Change-Id: I42fed52e5fdfe0a0ec99dfc8f77330b37a82f772
d87ee0f7b587bf19b7bf4c047aa6e5ab0c5045de 04-Nov-2013 Narayan Kamath <narayan@google.com> Add a test for lower case auth scheme handling.

bug: 11473660
Change-Id: I21cbff82508921b34b45ce2d62bfc959f6ca4b01
157b95d87eba99a4804aca480ced9c8b99637dc7 21-Aug-2013 Narayan Kamath <narayan@google.com> Update authentication tests.

Test for multiple schemes and multiple auth headers, but
insist that one of schemes is "Basic".

Fixes CTS tests
URLConnectionTest#testAuthenticateWithCommaSeparatedAuthenticationMethods
URLConnectionTest#testAuthenticateWithMultipleAuthenticationHeaders

(cherry picked from d1b438d58c2177c9cebcc3b72df13ac9b7c46e91)

bug: 10211309

Change-Id: Icdc30a5c52cc2c8e3b65abe402732658d4308a88
0136437c9973615e02f4a22b622399d6a7063932 21-Aug-2013 Narayan Kamath <narayan@google.com> Test that timeouts are respected on recycled connections.

This is a renamed version of testGetKeepAlive, which wasn't
testing very much in its old form.

(cherry picked from 35e58c073df4a45345e89fe8f4d0f77bf7df878)

bug: 10211309

Change-Id: I08c46f577741817b7de714d362f3426d17984042
8a1e42f2cfcb3cab8cfba7a572d68c534598d627 21-Aug-2013 Narayan Kamath <narayan@google.com> Fix tests dealing with retryable bodies.

Test them in a slightly more robust manner.
- Rely on the fallback from Modern TLS for the retry, instead
of a fallback due to a closed socket.
- Use mode DISCONNECT_AFTER_READING_RESPONSE to make sure the
response is consumed before being discarded.

(cherry picked from 2f1d4ee69ef9dc2eb0d9da37ba4ef1c6089d595e)

bug: 10211309

Change-Id: I8227148e1fc04b7557a41ee6485ffe98efb77ace
d1b438d58c2177c9cebcc3b72df13ac9b7c46e91 21-Aug-2013 Narayan Kamath <narayan@google.com> Update authentication tests.

Test for multiple schemes and multiple auth headers, but
insist that one of schemes is "Basic".

Fixes CTS tests
URLConnectionTest#testAuthenticateWithCommaSeparatedAuthenticationMethods
URLConnectionTest#testAuthenticateWithMultipleAuthenticationHeaders

Change-Id: Icdc30a5c52cc2c8e3b65abe402732658d4308a88
35e58c073df4a45345e89fe8f4d0f77bf7df8787 21-Aug-2013 Narayan Kamath <narayan@google.com> Test that timeouts are respected on recycled connections.

This is a renamed version of testGetKeepAlive, which wasn't
testing very much in its old form.

Change-Id: I08c46f577741817b7de714d362f3426d17984042
2f1d4ee69ef9dc2eb0d9da37ba4ef1c6089d595e 21-Aug-2013 Narayan Kamath <narayan@google.com> Fix tests dealing with retryable bodies.

Test them in a slightly more robust manner.
- Rely on the fallback from Modern TLS for the retry, instead
of a fallback due to a closed socket.
- Use mode DISCONNECT_AFTER_READING_RESPONSE to make sure the
response is consumed before being discarded.

Change-Id: I8227148e1fc04b7557a41ee6485ffe98efb77ace
cc440f43ee5cee8b52d6ad86c6926d1189aad37b 20-Aug-2013 Narayan Kamath <narayan@google.com> Track changes to MockWebServer

Track changes in ag/63871 which add bookkeeping requests
to the request queue.

(cherry picked from b27031a36bbb3c64ad0672553122dcebb17c89)

bug: 10211309

Change-Id: I8093bda336950846dafaaba2acaace8ee52713d6
3778c428ec5bc08881d8cc8057d79027648b327c 20-Aug-2013 Narayan Kamath <narayan@google.com> Update test exercising broken proxy behaviour.

The test must account for the fact that the connection
will be retried with TLS_MODE_COMPATIBLE if the first
attempt throws an exception.

It's also worth noting that MockWebServer does not
deal with abrupt client disconnections in a particularly
graceful manner (but that does not affect the test,
and I'll address it in a follow up).

(cherry picked from bfdb88fab84756703e01e9b43808a406bdd)

bug: 10211309

Change-Id: I5bf8a8e890df4146ecd0606e50c5a616434fd883
b27031a36bbb3c64ad0672553122dcebb17c89f3 20-Aug-2013 Narayan Kamath <narayan@google.com> Track changes to MockWebServer

Track changes in ag/63871 which add bookkeeping requests
to the request queue.

Change-Id: I8093bda336950846dafaaba2acaace8ee52713d6
bfdb88fab84756703e01e9b43808a406bdd48755 20-Aug-2013 Narayan Kamath <narayan@google.com> Update test exercising broken proxy behaviour.

The test must account for the fact that the connection
will be retried with TLS_MODE_COMPATIBLE if the first
attempt throws an exception.

It's also worth noting that MockWebServer does not
deal with abrupt client disconnections in a particularly
graceful manner (but that does not affect the test,
and I'll address it in a follow up).

Change-Id: I5bf8a8e890df4146ecd0606e50c5a616434fd883
3d849f3d37a0b7c4c8b7b0fa5a285289ed99a309 15-Aug-2013 Narayan Kamath <narayan@google.com> Update URLConnection#testLenientUrlToUriNul.

Our earlier behaviour was somewhat broken. We'd accept
hosts with \u0000 in them, and then produce a request with
a bad Host header. We now fail on such requests, so add a
unit test to exercise that new behaviour.

The ideal behaviour might be to be lenient and escape characters
that we don't like. (This would involve using the URI from
URL#toUriLenient to populate the Host header. I attempted that
but it has the side effect of introducing a new set of
incompatibilities).

(cherry picked from aafc934e9e3b5afce7c54162654720fad80)

bug: 10211309

Change-Id: I38a0d39124dc5ca766a6e963e72b0250440e82ee
aafc934e9e3b5afce7c54162654720fad80a733e 15-Aug-2013 Narayan Kamath <narayan@google.com> Update URLConnection#testLenientUrlToUriNul.

Our earlier behaviour was somewhat broken. We'd accept
hosts with \u0000 in them, and then produce a request with
a bad Host header. We now fail on such requests, so add a
unit test to exercise that new behaviour.

The ideal behaviour might be to be lenient and escape characters
that we don't like. (This would involve using the URI from
URL#toUriLenient to populate the Host header. I attempted that
but it has the side effect of introducing a new set of
incompatibilities).

Change-Id: I38a0d39124dc5ca766a6e963e72b0250440e82ee
0df27a0c1f64c589a1df3eb2d94c75aea90cdf4a 14-Aug-2013 Narayan Kamath <narayan@google.com> Fix URLConnectionTest#testConnectTimeouts.

Use StuckServer correctly. When StuckServer isn't
in blocking mode, its local socket address isn't 127.0.0.1.

Attempting to connect to localhost will then throw a
SocketException (ECONNREFUSED) instead of a
SocketTimeoutException.

(cherry picked from commit bf1a9e10eefd28bb3a989df20b4a57c745fb3670)

Bug: 10211309
Change-Id: I8aaab598d043b893e73fab9055082fa420cfb9cd
a37fb255a1993e835eea8c934205b1e568a1271c 14-Aug-2013 Narayan Kamath <narayan@google.com> Fix URLConnectionTest#testConnectTimeouts.

Use StuckServer correctly. When StuckServer isn't
in blocking mode, its local socket address isn't 127.0.0.1.

Attempting to connect to localhost will then throw a
SocketException (ECONNREFUSED) instead of a
SocketTimeoutException.

(cherry picked from commit bf1a9e10eefd28bb3a989df20b4a57c745fb3670)

Bug: 10211309
Change-Id: I8aaab598d043b893e73fab9055082fa420cfb9cd
bf1a9e10eefd28bb3a989df20b4a57c745fb3670 14-Aug-2013 Narayan Kamath <narayan@google.com> Fix URLConnectionTest#testConnectTimeouts.

Use StuckServer correctly. When StuckServer isn't
in blocking mode, its local socket address isn't 127.0.0.1.

Attempting to connect to localhost will then throw a
SocketException (ECONNREFUSED) instead of a
SocketTimeoutException.

Change-Id: I8ea1af80996894a5951e53f9c31e828bbbca3628
8c213bcc2aadb8249d683312505f1068ae74f1a8 12-Jun-2013 Narayan Kamath <narayan@google.com> Fix URLConnectionTest after latest okhttp update.

I've observed 14 failing tests both before and after
the update.

Change-Id: I40dfd9efe35ed03d89b38b030d3c7b6558b247e2
d4781a20611fd0424aede028c139bfdbaea5677b 06-May-2013 Brian Carlstrom <bdc@google.com> Make it clearer that a new MockWebServer is created for each test run

Change-Id: Ib3ce11f42d19688fe00b7d057eece25567fccea2
2503556d17b28c7b4e6e514540a77df1627857d0 30-Mar-2013 jwilson <jwilson@squareup.com> Switch to OkHttp as URL's preferred HTTP implementation.

Change-Id: Id724b75dd78b68ed00f5db4989c4070896996ec0
0e1afa1091f74a6228c01d8c7a8eebf001efdc57 13-Oct-2012 Elliott Hughes <enh@google.com> Fix ConcurrentCloseTest flakiness.

We can't rely on consuming all the listen(2) backlog. For the tests we've
seen fail because they sometimes connect rather than time out, switch to
an unroutable address.

(cherry-pick of babccbf9e429c4c78aca24c205825ceaaf7d3f37.)

Bug: 6971145
Change-Id: Ibfa412ff1ad7da7e63842d0162cc67a706e2b27e
babccbf9e429c4c78aca24c205825ceaaf7d3f37 13-Oct-2012 Elliott Hughes <enh@google.com> Fix ConcurrentCloseTest flakiness.

We can't rely on consuming all the listen(2) backlog. For the tests we've
seen fail because they sometimes connect rather than time out, switch to
an unroutable address.

Bug: 6971145
Change-Id: I259d31b1a15123bcd78c36849d5ed863d392ac20
b11e44a402eb0f9c5da1f7482fc1eabdd9adff47 20-Sep-2012 Jesse Wilson <jwilson@squareup.com> Fix a bug in tunnel construction and 'Connection: close' headers.

Based on https://github.com/square/okhttp/pull/30
(git fetch git://github.com/square/okhttp.git && git cherry-pick -x b8c51dc5bdc89d5487cbc110d6fe40389de16480)

Bug: http://code.google.com/p/android/issues/detail?id=37221
Bug: 7291446

(cherry picked from commit 4bedacd569fed2db56c518ed239412b3fe32245e)

Change-Id: I68c55e9259db91dbccca30824c00726094570304
4bedacd569fed2db56c518ed239412b3fe32245e 20-Sep-2012 Jesse Wilson <jwilson@squareup.com> Fix a bug in tunnel construction and 'Connection: close' headers.

Based on https://github.com/square/okhttp/pull/30
(git fetch git://github.com/square/okhttp.git && git cherry-pick -x b8c51dc5bdc89d5487cbc110d6fe40389de16480)

Bug: http://code.google.com/p/android/issues/detail?id=37221
Change-Id: I5bed33d9ab16002aa38c2f729fa14a2022485469
6d41a7cc3cb4cc684c8bece69ddc55954812ad6e 24-Sep-2012 Narayan Kamath <narayan@google.com> Strip content length in requests with "transparent" gzip handling.

We need to strip both the Content-Length and the Content-Encoding
for such requests. In such requests, it will be the length of the
compressed response. We hide the fact that compression is taking place
from clients, so we shouldn't give them the content length either.

(cherry picked from commit f9d60aed414ae21811a6488f603333517f257b22)

Change-Id: Ic2776ecf020c34b1c55e2fb7e2f0728e553187a0
f9d60aed414ae21811a6488f603333517f257b22 24-Sep-2012 Narayan Kamath <narayan@google.com> Strip content length in requests with "transparent" gzip handling.

We need to strip both the Content-Length and the Content-Encoding
for such requests. In such requests, it will be the length of the
compressed response. We hide the fact that compression is taking place
from clients, so we shouldn't give them the content length either.

Change-Id: I80713ab33143945c5e2656f478d83cc9e60226a8
3edd28a92fc86a1260347d0995e65a815d73bbbe 16-Apr-2012 Mattias Petersson <mattias.petersson@sonymobile.com> Fix problem with Runtime.runFinalization()

This is a fix for a problem with runFinalization(). The
problem was that all FinalizerReferences to objects that had
not yet been garbage collected were lost when calling this
function. When a FinalizerReference was lost, it is was not
possible to call the finalize() method when the object
was garbage collected.

The result was that finalizers was sometimes never
called, which typically lead to memory leaks.

Also stop synchronizing on the class itself; use a private
lock instead.

Bug: 6907299
Bug: 5462944 # Synchronization on FinalizerReference.class
Change-Id: Ief515edbb5a1823c06d7371415d131165baef7f2
8155888a2c4e7cc28596deec28433e1984cfaf11 25-Jul-2012 Brian Carlstrom <bdc@google.com> Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream

java.lang.Throwable: Explicit termination method 'end' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at java.util.zip.Inflater.<init>(Inflater.java:82)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96)
at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81)
at libcore.net.http.HttpEngine.initContentStream(HttpEngine.java:523)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:831)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
at ...

Bug: 6602529
Change-Id: I9b49cbca561f8780d08844e566820087fdffc4d7
4ec2d0dea800397fb32227e0631246f4d2a73191 29-Jun-2012 Brian Carlstrom <bdc@google.com> HttpEngine should not attempt to cache proxy CONNECT responses

This fixes an issue where a bad proxy repsonse that included a body
would turn into an IllegalStateException instead of an IOException.

Bug: 6754912

Change-Id: I204ad975820693d6add2780d7b77360463e33710
deb26711801f9bfafcd5cad20963b3c3913404fd 04-Apr-2012 Elliott Hughes <enh@google.com> Add a test for an already-fixed publicly-reported bug.

Bug: http://code.google.com/p/android/issues/detail?id=28095
Change-Id: I26ff2834becce6f51e668ec71b4e5050b15f06cd
0731920fdf845358cc13ce78292f9e80e143f915 28-Mar-2012 Brian Carlstrom <bdc@google.com> Disable TLSv1.1 and TLSv1.2 by default

Bug: 6234791

Change-Id: I5d829211c9e1d5672fc96e42ef603c53d789e695
3d74b4bec8543e6e3f89eafe3afe0925f3a69f01 28-Mar-2012 Brian Carlstrom <bdc@google.com> Disable TLSv1.1 and TLSv1.2 by default

Bug: 6234791

Change-Id: I5d829211c9e1d5672fc96e42ef603c53d789e695
3e6dd45baa0d7f9b4fa06f4ade76e088b59cc7bf 16-Mar-2012 Brian Carlstrom <bdc@google.com> Tracking openssl-1.0.1

Bug: 6168278

Change-Id: I240d2cbc91f616fd486efc5203e2221c9896d90f
df29c7dc69965462cd19de8910b04c8cb463e57f 15-Feb-2012 Jesse Wilson <jessewilson@google.com> Don't attempt to parse an HTTP response body on HEAD requests.

Previously if the response had a Content-Length or Transfer-Encoding
header we assumed it had a body. This was untrue of HEAD requests.
This is not a regression.

Bug: http://code.google.com/p/android/issues/detail?id=24672
Change-Id: I264db2014e681a6f8e93cd40b0f1640c95103d21
a468471e8ccc2f642d5b2ae3c75873a74267ece2 26-Jan-2012 Jesse Wilson <jessewilson@google.com> Don't throw needlessly when returning the CacheResponse.

We were throwing under the premise that we'd always have
response headers before we had a cached body. But when the
user calls connect() we'll have queried the cache but we
won't necessarily have response headers from the server yet.
That's because connect() doesn't require a response to be ready.

Bug: http://b/5920659
Cherry-picked from: I9d69b44b5be3d0e29f14d8b83781f6e65c67582a

Change-Id: Ia403b42ddc9783fd1456164f4b7350da3ce80566
fa5e8dfe3c7ed144b0fbe69091628dedd6a3b961 21-Dec-2011 Jesse Wilson <jessewilson@google.com> Don't reuse an SSL socket if the socket factory has changed.

Bug: http://b/3042192
Change-Id: Iaa9deb69058afcca4ab79ca6ba745c55d1e9321a
abe4e615f473b387b1c00a738062a7c428f05a33 20-Dec-2011 Jesse Wilson <jessewilson@google.com> Unit test SSL fallback.

Bug: http://b/4462288
Change-Id: I9a29c70b24f235df15aa9a763ae5217e10e42f83
5757cb35ad2e58d7accb7f5d3db6f2d5e72f097d 16-Dec-2011 Jesse Wilson <jessewilson@google.com> Support multiple challenges for HTTP authentication.

This fixes the problem reported in the bug, but we still need
to give attention to the digest scheme. Currently we can't do
Basic auth if the HTTP response contains both a Digest challenge
and a Basic challenge!

Bug: http://code.google.com/p/android/issues/detail?id=19081
Change-Id: Ifffb307678c2afa0db1d50c1ef5fc49ec7769306
b2b02ac6cd42a69463fd172531aa1f9b9bb887a8 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Change the way we cope with stale pooled connections.

Previously we'd attempt to detect if a connection was stale by
probing it. This was expensive (it relied on catching a 1-millisecond
read timing out with a SocketTimeoutException), and racy. If the
recycled connection was stale, the application would have to catch
the failure and retry.

The new approach is to try the stale connection directly and to recover
if that connection fails. This is simpler and avoids the isStale
heuristics.

This fixes some flakiness in URLConnectionTest tests like
testServerShutdownOutput and testServerClosesOutput.

Bug: http://b/2974888
Change-Id: I1f1711c0a6855f99e6ff9c348790740117c7ffb9
2d9fa917aae6a6da38e9d1eda05841ffdf8855bb 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Document the effect on timeouts of having both IPv4 and IPv6 addresses

Bug: http://b/3441111

Change-Id: Ib4c2e3e0d8d86eb5eb77cf92a0814c7444fd153f
0613de89655e481fa610bfd4f1bcaeeae3272205 14-Dec-2011 Jesse Wilson <jessewilson@google.com> Document that disconnect() doesn't release sockets.

We could make disconnect() work, but it's a lot of complexity for
little gain. The core problem is that by the time the user calls
disconnect(), the connection has already been pooled. On the RI,
disconnect() will close a socket connection if it hasn't yet been
removed from the pool. Our pooling always-on or always-off behavior
is simpler and more predictable.

Bug: http://b/4148042
Change-Id: I61ef2ccb898f3ffaa08cedc70ee9e728fc1889b9
d0d626655f1d452070d3116678037e8759f807f4 10-Nov-2011 Jesse Wilson <jessewilson@google.com> Don't NullPointerException when a URL contains a space.

We end up creating a URI of http://and%20roid which has no host
name part because and%20roid is not a valid host name. It's unclear
where the best place to fail is. This is consistent with the RI
which doesn't fail until it attempts to connect.

Bug: http://code.google.com/p/android/issues/detail?id=16895
Change-Id: Ifa4dc3c651f4627e27622ed5cedfa820f9a35358
25a753691a80186cd4d7086b12c0e52225d95897 30-Sep-2011 Jesse Wilson <jessewilson@google.com> Fix chunked input stream's available() method to never return -1.

Change-Id: I6ea268e469675ef890010282dbe35ed5838cca73
http://code.google.com/p/android/issues/detail?id=20442
09336c914b4fc813e493acc82469b9ad89fd8694 07-Jun-2011 Jesse Wilson <jessewilson@google.com> Use external/mockwebserver in libcore

Change-Id: I4dac34f88b23484643bce31e5f25ac6eb1fea426
5292410e4ebf7fb5149eefd2f52fcb94c46690a6 24-May-2011 Jesse Wilson <jessewilson@google.com> Rewrite parsing for java.net.URL.

This fixes many broken cases on handling relative URLs.

We normalize all URLs by default. This will result
in more URL equality than before. Previously the URLs
http://android.com/a/../ and http://android.com/ were not
equal; now they are equal.

Change-Id: I8cf7be2e42eeb1386520be2698d8f14e0a55decb
http://b/4361656
ec6163ceac64902ccde3259e8a426f0f9ad6a88c 20-May-2011 Jesse Wilson <jessewilson@google.com> Add test cases inspired by Jetty-dependent Harmony tests.

Change-Id: Id8288e0524b64255c5d9808d3f5582708211d96b
1e518e80aeb8c27d49d51e5c69173d3e08fb9ec7 09-May-2011 Jesse Wilson <jessewilson@google.com> Deduplicate a unit test merged in from upstream.

Change-Id: Ia5f4ad1753fa6bb2ce4dd5fdf4c978e1ff0ffa80
http://b/4188137
68b8820c82a524388a32501fa9b423d77b4b73b6 09-May-2011 Jesse Wilson <jessewilson@google.com> Deduplicate a test that was duplicated by an automerge.

Change-Id: Id8ef04b21c1132db224c69437428bbe4f5890a6a
http://b/4188137
5e8b5a55eda914b67c62b4e77152922d5c77eb68 29-Mar-2011 Jesse Wilson <jessewilson@google.com> Don't read from the delegate stream after we close it.

Honeycomb MR2 patch cherry-picked from bc4c79c6a2059003f695f7ad204de36700e8d701

Change-Id: Ib379595a1e6b2ed3b16d4d82c744b00e4b576c51
http://b/4188137
c996149b500fc4825156106554457fe2394ae087 06-May-2011 Jesse Wilson <jessewilson@google.com> Fix proxy+HTTPS to handle authentication requests from the proxy.

Previously I'd introduced a bug by assuming that CONNECT
responses would always be successful.

Change-Id: Iaf0caf67f52154f6951a20284c75db0090843b99
http://b/4188137
d742d7fc7f0593eb8c6e4ac9dd4c0f6a80374e46 05-May-2011 Jesse Wilson <jessewilson@google.com> Use GET after a POST is redirected.

Also dropping support for response code 305 Use Proxy, which
is seldom used, and whose behavior is quite different from
Chrome and Firefox. This is an intentional delta from the RI.

Also testing disconnect().

Change-Id: I80433f4776a2cfc5e228179421a787a44a4ded69
http://b/3180373
953df613522e12a418cb7cb73248594d6c9f53d4 03-May-2011 Jesse Wilson <jessewilson@google.com> Refactor HttpURLConnection implementation.

Break HttpURLConnectionImpl into two parts: the part that
implements the Java API (that follows redirects etc.) and
the part that speaks HTTP. The HTTP part is called HttpEngine,
and it can only be used for a single HTTP request. This makes
it easier to set request properties that only apply to a
single socket request.

Tests for 'Vary', 'Content-Location' and warnings.

For simplicity of implementation I've chosen not to support
'Vary' at this time.

The 'Content-Location' header doesn't require any work from
the cache.

Warnings are ugly but allow the caller to identify when the
cache results may be problematic.

Also breaking HttpResponseCache's dependency on HttpURLConnectionImpl
so it can be tested on the RI.

Change-Id: Idbabb51251f479c2cdea4e0fceb029bfd07182be
http://b/3180373
0c59055dd24e1659f85d9ff7e2148883f663bd62 27-Apr-2011 Jesse Wilson <jessewilson@google.com> Support conditional gets in HttpURLConnection.

This is the first step towards adding an HTTP response cache.
There's still much to do; details are listed on the bug.

Change-Id: Ie693fe424d1d90e90576fc959595e4d96a31f767
http://b/3180373
5f03a4682a71e56535059258a4d41150b99177d7 05-Apr-2011 Jesse Wilson <jessewilson@google.com> Fix a test that was merged from both GB and HC.

Change-Id: I8cf7dec2dcec177669a04951635c95c78d8c7aaf
http://b/4188137
bc4c79c6a2059003f695f7ad204de36700e8d701 31-Mar-2011 Jesse Wilson <jessewilson@google.com> Don't read from the delegate stream after we close it.

Change-Id: Ib724b170f7ec10ea0025c0e2e7978119fd070eb6
http://b/4188137
0c2fd828abec671333b8b88281825fd27a783723 30-Mar-2011 Jesse Wilson <jessewilson@google.com> Fix MockWebServer to use the same hostname as TestKeyStore.

Change-Id: I31c9f6e9add87a17737eac4f09949540e5da8cb5
f241d462634527692b7d99335cdc8c11883ac966 29-Mar-2011 Jesse Wilson <jessewilson@google.com> Don't read from the delegate stream after we close it.

Change-Id: I9a018ca88373d5f317335e35fc6ca43c5473490e
http://b/4188137
32559028b14b9b321b10eede050afd554a376569 09-Feb-2011 Jesse Wilson <jessewilson@google.com> Use the same code to encode and fix poorly encoded URLs.

Don't permit digits outside of ASCII.

Change-Id: I47b756c32e67b7415e35ae9eb55b735d1c22a36d
http://b/3436051
38db242d16a5a31fd86c519b817ae94c5fc89417 27-Jan-2011 Elliott Hughes <enh@google.com> Consistently use "expected" for expected exceptions in our tests.

Change-Id: I796624fb53dbba420d43858741c9a97b4fb8d017
afd9b157f467b7c4f2f0b5592dca72f18d844602 20-Jan-2011 Jesse Wilson <jessewilson@google.com> Handle the CacheResponse returning a null body.

Change-Id: I45c4d6b7cac5cabd8c42f5e17d110fb5b3ecc9cc
http://b/3373699
d1b5e5da828434388e486a388710d21e4306dae0 20-Jan-2011 Jesse Wilson <jessewilson@google.com> Fix URL character bugs by adding yet another encoder.

We don't have an encoder that ignores already escaped
characters.

Change-Id: I9ff080ad1745136b7d7313d78af2b0ca1785b200
http://b/3360947
b7f4d6c3968c372767b2510f38a3d506067aced6 13-Jan-2011 Jesse Wilson <jessewilson@google.com> Move tests from android.core.URLTest to URLConnectionTest.

This includes some changes to MockWebServer to make it stop
accepting connections as soon as its response queue is empty.

Change-Id: I5a6bcdf1c03d0c36b11552ae086d0dece0440f64
http://b/1158780
fa9f91a486b81b19db13eab59e704179381de22f 12-Jan-2011 Jesse Wilson <jessewilson@google.com> Fix typo in testResponseCacheCallbackApis().

Embarassing. Test passes with the typo fixed!

Change-Id: Ic348f68c0e720163ca77b125415b01e840c7412d
f14bee4dbf9f724a177a85a7b73f7b0bc6df1ec0 06-Jan-2011 Jesse Wilson <jessewilson@google.com> Return HTTP headers even if there is no HTTP response body.

Also add a test to demonstrate that we've bug 7787.
http://code.google.com/p/android/issues/detail?id=7787

Change-Id: I4e320835516c05ec9e305661b5bbb1e59b278183
e942f46f10bb9384a1b186b3d7b74f9704c57090 17-Dec-2010 Jesse Wilson <jessewilson@google.com> Test that HttpURLConnection responds gracefully when the server closes a socket.

Change-Id: I5110d58d91e7c6f8f7553ad400f0bd841bcf07b6
http://b/2612240
2915378e253f08e47fe5a9bfd026cd1ca7c6c351 16-Dec-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnection retry should not invoke X509TrustManager and HostnameVerifier more than once

Summary:

In 2.3, HttpsURLConnection was change to retry TLS connections as SSL
connections w/o compression to deal with servers that are TLS
intolerant. However, if the handshake proceeded to the point of
invoking the X509TrustManager, we should not retry. Similarly, if we
should not invoke the HostnameVerifier repeatedly, and need to wait
until the SSL handshake has completed.

Tested with (includes two new tests for this issue):
libcore/luni/src/test/java/libcore/javax/net/ssl/
libcore/luni/src/test/java/libcore/java/net/URLConnectionTest.java
libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/HttpsURLConnectionTest.java

Details:

HttpConnection.setupSecureSocket has been broken into two
pieces. setupSecureSocket now just does the SSL
handshaking. verifySecureSocketHostname now does the
verification. The old HttpConnection code was careful never to
assign its sslSocket field until verification was complete. A new
unverifiedSocket field is added to store the sslSocket before
verification is completed by verifySecureSocketHostname.

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java

HttpsEngine.makeConnection now skips TLS intolerant retry if the
reason for the makeSslConnection failure was a
CertificateException, since that implies that we failed during
certification validation after initial handshaking. We also
prevent retrying hostname verification by moving it out of
makeSslConnection and only doing it on new SSL connections,
tracking the changes to HttpConnection.setupSecureSocket mentioned
above. We also now skip the redundant call to setUpTransportIO in
makeSslConnection on reused SSLSockets.

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java

Instead of throwing away the underlying CertificateExceptions, set
them as the cause of the SSLExceptions. This is what the RI does
in the case of X509TrustManager failures and is now used by
HttpsEngine.makeConnection.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java

Added new testConnectViaHttpsToUntrustedServer which makes sure
that connections are not retried on certificate verification
failure.

luni/src/test/java/libcore/java/net/URLConnectionTest.java

Added new test_SSLSocket_untrustedServer that verifies that an
SSLHandshakeException is thown containing a CertificateException
is thrown on certificate verification problems.

luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java

Added second test CA and a new TestKeyStore.getClientCA2 test key
store that does not trust the primary test key stores. This is
useful for negative testing and is used in the above two new
tests.

support/src/test/java/libcore/java/security/TestKeyStore.java

Issue: http://code.google.com/p/android/issues/detail?id=13178
Bug: 3292412

Change-Id: I37136bb65f04d2bceaf2f32f542d6432c8b76ad4
c6dae581716b9362a5c7f166c80a7f2b46ed1124 06-Nov-2010 Jesse Wilson <jessewilson@google.com> Throw the expected exception after the response failed.

Change-Id: I4c2ed726d41d6b55e27a503467a412fa05242383
http://b/3172197
35eef71e8ce721c4199c525890ecc1a263054596 02-Dec-2010 Jesse Wilson <jessewilson@google.com> Fix two bugs with HTTPS + file uploads.

Firstly, we weren't echoing calls to setFixedLengthStreamingMode
and setChunkedStreamingMode from the HTTPS adapter down to the
real HTTP client.

Secondly, we were calling setTransportIO twice, and the second
call destroyed the buffer of our request body stream. That buffer
has only existed since change Id22a8449118a4b8dd13e71915700ac78803d2d9f,
(November 2, 2010) so the impact of that problem is limited.

Change-Id: Icb0eb2e0ca4e201a629bd74c3b98e852f6cc0fd3
http://code.google.com/p/android/issues/detail?id=12860
253851cdb2904082c205949da273c455d197c083 01-Dec-2010 Jesse Wilson <jessewilson@google.com> Do not merge: Fix a bug where we weren't pooling connections due to mismatched URLs.

Already committed to master as change 78504.

Change-Id: Ib883e92bb03b142f34449ef1314c57878dcc00f0

http://b/3169861
dbc42ad94ce37b3178e14b50496914c267d6cea6 16-Nov-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnection fixes to pass URLConnectionTest and HttpsURLConnectionTest

Add public getSecureSocket so that HttpsURLConnection can reset its sslSocket field on reused connections.

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java

discardIntermediateResponse now maintain old values for
intermediateReponse, which is necessary when retrying the CONNECT
method with proxy authorization.

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java

Clear sslSocket before retrying makeSslConnection to ensure we reconnect.
makeSslConnection now resets sslSocket on resumed connection.
makeSslConnection now exits early on existing connection.

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java

git cherry-pick -e 4df5be29bdffc09e7368c03423a0bef85fa26ac5
Bug: 3184701
Change-Id: Ida3c027f79e5e29968263ac761d4f4f79d063a27
5bcbe1c84468a25fec1e5b4e1dd636f917c73422 16-Nov-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnectionTest rewrite and URLConnectionTest updates

Rewrote HttpsURLConnectionTest to work with current SSLSocket
implementation which more strictly follows RI behavior.

Also made upates to URLConnectionTest related to HttpsURLConnection
- changed assertContent call connect() explictly to illustrate problem
with https proxy case also seen by HttpsURLConnectionTest
- Rewrote testConnectTimeouts to work reliably. Before if often
worked on WiFi but not on mobile networks where a "HTTP/1.1 501 Bad
Gateway" would be seen causing a FileNotFoundException.
- Changed testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty
to match expectation that https does not use the http.proxyHost
values. Added new testConnectViaHttpProxyToHttpsUsingProxyArgWithNoProxy
which should have the same behavior as the fixed
testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty

git cherry-pick -e f02c695ed03e708623d9365dec26d533356ef2d0

Bug: 3184701
Change-Id: Id25f619d2437db607deaf35aeb1d5e817514b92f
5fc5dde4c719c1dfdac46b67d5d2e4884d07721e 16-Nov-2010 Elliott Hughes <enh@google.com> Improve ConcurrentCloseTest.

No more flaky use of 10.* addresses.

Bug: 3044772
Change-Id: I5ca8dc431b50950efdc818efe73eb9aba76ea67f
f02c695ed03e708623d9365dec26d533356ef2d0 16-Nov-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnectionTest rewrite and URLConnectionTest updates

Rewrote HttpsURLConnectionTest to work with current SSLSocket
implementation which more strictly follows RI behavior.

Also made upates to URLConnectionTest related to HttpsURLConnection
- changed assertContent call connect() explictly to illustrate problem
with https proxy case also seen by HttpsURLConnectionTest
- Rewrote testConnectTimeouts to work reliably. Before if often
worked on WiFi but not on mobile networks where a "HTTP/1.1 501 Bad
Gateway" would be seen causing a FileNotFoundException.
- Changed testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty
to match expectation that https does not use the http.proxyHost
values. Added new testConnectViaHttpProxyToHttpsUsingProxyArgWithNoProxy
which should have the same behavior as the fixed
testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty

Change-Id: I397f55905524e2bbb587533f258ef0418ca8af80
06e15e6c528fcb773bedb43e34b0577312570927 05-Nov-2010 Jesse Wilson <jessewilson@google.com> Fix a bug where we weren't pooling connections due to mismatched URLs.

Change-Id: I13bebc94189192c3f8d959e521989591d2fca3e2
c1a675c80c69decadb736b245f0366f93a94a462 29-Oct-2010 Jesse Wilson <jessewilson@google.com> Remove the tree map in the HTTP headers.

This map is intended make looking up headers faster, but for real-world
sized datasets we spend more energy maintaining the map than we save from
using it.

I benchmarked the Android Market's HTTP connections' header use and it's
significantly faster to skip the map:

run us linear runtime
map+list 413.1 ==============================
list only 65.8 ====

Change-Id: I5b8fef6f999eb1bfe53eea2781f63cdd1002a273
8ac847a52e72f0cefbb20a6850ae04468d433a9e 28-Oct-2010 Jesse Wilson <jessewilson@google.com> Fix broken interactions between HTTP response caches and redirects.

This fixes several specific problems:
- HTTP header map didn't contain the status line (under the null key)
- response code, message and version weren't set by caches
- caches didn't work with redirects

This change also makes some significant cleanup to the Headers class.
We might be able to simplify this further by dropping the map, should
that prove efficient enough.

Change-Id: Ib79ec17bef5978b3234f68102114eee7d4b7cda2
http://b/3139211
http://b/3139211
37dcf5581f177229ca6c8e7d0d640361640bfb00 27-Oct-2010 Jesse Wilson <jessewilson@google.com> Fix ResponseCache to support caching of HTTPS responses.

Previously it would fail with an internal error because of
inconsistencies because HttpURLConnectionImpl claimed to be
'connected' when it had a cache hit, and HttpsURLConnection
acted upon this by talking to its sockets.

Change-Id: I51f4215ceb9c5fd851223a501488306fa6d382b1
http://b/3043966
984fcff696380abd6ea14e80030f9fd2d09dbad0 14-Oct-2010 Jesse Wilson <jessewilson@google.com> Tests for HTTP bugs using HTTPS through a proxy.

Change-Id: I01b470204d4da46016794ab7040d5751e7116958
http://b/3097277
http://b/3097518
f29ad8a60254345d1943d1b3836482395a7c916f 30-Sep-2010 Jesse Wilson <jessewilson@google.com> Don't explode if flush() is called when an HTTP upload stream is closed.

Streams like BufferedOutputStream always call flush() even if it is
a no-op. These flushes must be permitted for compatibility with apps
that don't call close() until after the response has been retrieved.

Change-Id: Ic5c86ab6050c6c4d166c44ae5b4fc7a1688e7e45
http://b/3038470
1f8243e3d2b5a3f8e0398c304d1dea0395cbc368 28-Sep-2010 Jesse Wilson <jessewilson@google.com> Remove java.net tests that are redundant with Harmony.

Change-Id: I01d6b3633a6de8a075982975d4cbf6c08e757490
00feece22909b7dc79fc96d666d157390b93858e 24-Sep-2010 Jesse Wilson <jessewilson@google.com> Strip usage of the term 'localhost' from URLConnectionTest.

Change-Id: I8ea7923c3ea72728c7df64c13bdd6f94b91be121
http://b/3032912
ef66494dce45a0b7ec22ec3fb20c60096517a4e3 22-Sep-2010 Jesse Wilson <jessewilson@google.com> Fix problem where single-byte reads were unsigned.

Change-Id: Ib0bc273698b71d13a90a03a8c60498ad7de5ad9d
http://b/3023872
d4bddd7d1fb7b1b7f0836648228235c6e4b56a18 16-Sep-2010 Jesse Wilson <jessewilson@google.com> Fix two HTTP issues that came up when writing HttpURLConnection docs.

We're now more careful about which headers are sent to HTTP proxies.
And getContentEncoding() is better documented.

Change-Id: I04241f99c2f32c25ba005fbd6ff9ef7236c3c9d3
8116f7e97e00d223e7fbe5c950c9a5e3277de124 17-Sep-2010 Jesse Wilson <jessewilson@google.com> Don't leave the Content-Encoding header around after transparent gzip.

Otherwise clients may be tempted to double-decompress.
http://b/issue?id=3009828

Change-Id: I4832da1c2aff9bad8d452ffc4a0f98ee27d44f49
65d890eb22aeba9b009ee642ffd4fff48a6f98ae 08-Sep-2010 Jesse Wilson <jessewilson@google.com> Cope with HTTP responses where the response code and headers disagree.

See http://b/issue?id=2981779

Change-Id: I0e4ed8f0cc606aa419704ba2eb5cd9938b5ff320
b7155fd57239e986bbaba254a91aeb9600d60305 03-Sep-2010 Jesse Wilson <jessewilson@google.com> Fixing a broken pipe with HttpsURLConnection connection reuse.

We had a bug where we were peeking a byte from the raw socket
stream rather than the encrypted stream when we were attempting
to reuse an HTTPS connection. The raw stream field shouldn't
have been initialized, but setupTransportIO() did it while the
connection was being established.

This fixes setupTransportIO() to not initialize the fields
and isStale() to use the SSL fields if they exist.

See http://code.google.com/p/android/issues/detail?id=8625

Change-Id: Idd5b6f20e098adf436997829940707548896bedb
50ae32218918eae80298bd1ab8e4f588bbbabdb2 01-Sep-2010 Jesse Wilson <jessewilson@google.com> Configure HttpURLConnection to prefer gzipped content by default.

This is not what the RI does. But the bandwidth savings is substantial,
and we can offer it almost for free.

See http://code.google.com/p/android/issues/detail?id=9390

Change-Id: I43c3fae8938f33809f2526d2d0e1cc5e08ae1202
f418bf447fd007cd2ec2d45b4b0399a11904e9b4 30-Aug-2010 Jesse Wilson <jessewilson@google.com> Support "Connection: close" from both request and response.

This is a rewrite of fix for the same problem in AOSP master:
https://review.source.android.com/16757

This expands on that fix by supporting "Connection: close" on
redirects by adding test coverage.

Change-Id: Ia0daa9d83cf9f557b4e9a99b2c51345c98c6db14
125f068f0a6cd739beac97821c9421cf8317cc87 20-Aug-2010 Jesse Wilson <jessewilson@google.com> Fix a bug when user sets "Content-Encoding: chunked" manually.

We used to try to build a -1-sized ByteArrayOutputStream, which
failed miserably with an exception.

Change-Id: Ia6fa72c639a14c03f03b6f73083ce37ffab8b4e5
4557728efb66c455a52b7669a8eefef7a9e54854 11-Aug-2010 Jesse Wilson <jessewilson@google.com> Moving tests to be under the libcore.* package.

This is indended to make it easier to run on VMs that restrict the packages
from which application classes can be loaded. For example, on the RI you need
to use the bootclasspath to load these tests.

Change-Id: I52193f35c5fcca18b5a3e1d280505b1e29b388af