From 52301e0a862c60f63bddc967e69043d756374077 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 10 Apr 2013 12:03:34 +0200 Subject: [PATCH 1/2] Fixing S3ClientMockTest hanging on Java 7 since 843ed57 --- apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java b/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java index 81ef01db17..a040eb0c4a 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java @@ -71,13 +71,15 @@ public class S3ClientMockTest { public void testZeroLengthPutHasContentLengthHeader() throws IOException, InterruptedException { MockWebServer server = new MockWebServer(); server.enqueue(new MockResponse().setBody("").addHeader(ETAG, "ABCDEF")); + // hangs on Java 7 without this additional response ?!? + server.enqueue(new MockResponse()); server.play(); S3Client client = getS3Client(server.getUrl("/")); S3Object nada = client.newS3Object(); nada.getMetadata().setKey("object"); nada.setPayload(new byte[] {}); - + assertEquals(client.putObject("bucket", nada), "ABCDEF"); RecordedRequest request = server.takeRequest(); From 282f3e2a37be784be4ad9128b4b0c259829b85bf Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 10 Apr 2013 13:04:44 +0200 Subject: [PATCH 2/2] Trying to get the test to *pass* now --- apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java b/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java index a040eb0c4a..d1b633f3cb 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java @@ -70,9 +70,9 @@ public class S3ClientMockTest { public void testZeroLengthPutHasContentLengthHeader() throws IOException, InterruptedException { MockWebServer server = new MockWebServer(); - server.enqueue(new MockResponse().setBody("").addHeader(ETAG, "ABCDEF")); + server.enqueue(new MockResponse().addHeader(ETAG, "ABCDEF")); // hangs on Java 7 without this additional response ?!? - server.enqueue(new MockResponse()); + server.enqueue(new MockResponse().addHeader(ETAG, "ABCDEF")); server.play(); S3Client client = getS3Client(server.getUrl("/"));