--- a/test/jdk/java/net/httpclient/MockServer.java Wed Jan 31 14:38:52 2018 +0000
+++ b/test/jdk/java/net/httpclient/MockServer.java Wed Jan 31 15:52:35 2018 +0000
@@ -60,7 +60,7 @@
// to the test client.
final String root;
- // waits up to 20 seconds for something to happen
+ // waits up to 2000 seconds for something to happen
// dont use this unless certain activity coming.
public Connection activity() {
for (int i = 0; i < 80 * 100; i++) {
--- a/test/jdk/java/net/httpclient/SplitResponse.java Wed Jan 31 14:38:52 2018 +0000
+++ b/test/jdk/java/net/httpclient/SplitResponse.java Wed Jan 31 15:52:35 2018 +0000
@@ -180,11 +180,13 @@
r = client.send(request, asString());
}
- if (r.statusCode() != 200)
- throw new RuntimeException("Failed");
+ out.println("response " + r);
+ String rxbody = r.body();
+ out.println("response body:[" + rxbody + "]");
- String rxbody = r.body();
- out.println("received " + rxbody);
+ if (r.statusCode() != 200)
+ throw new RuntimeException("Expected 200, got:" + r.statusCode());
+
if (!rxbody.equals(body))
throw new RuntimeException(format("Expected:%s, got:%s", body, rxbody));
@@ -203,21 +205,21 @@
// Sends the response, mostly, one byte at a time with a small delay
// between bytes, to encourage that each byte is read in a separate read
Thread sendSplitResponse(String s, MockServer server) {
- System.out.println("Sending: ");
+ System.out.println("Server: creating new thread to send ... ");
Thread t = new Thread(() -> {
- System.out.println("Waiting for server to receive headers");
+ System.out.println("Server: waiting for server to receive headers");
conn = server.activity();
- System.out.println("Start sending response");
+ System.out.println("Server: Start sending response");
try {
int len = s.length();
- out.println("sending " + s);
+ out.println("Server: going to send [" + s + "]");
for (int i = 0; i < len; i++) {
String onechar = s.substring(i, i + 1);
conn.send(onechar);
Thread.sleep(10);
}
- out.println("sent " + s);
+ out.println("Server: sent [" + s + "]");
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
}