On Fri, 25 Feb 2022 15:06:29 GMT, Mahendra Chhipa <d...@openjdk.java.net> wrote:
>> Updated following remaining tests to remove depenedies of TestHttpServer, >> HttpTransaction, HttpCallback >> open/test/jdk/java/net/ProxySelector/LoopbackAddresses.java >> open/test/jdk/java/net/ProxySelector/ProxyTest.java >> open/test/jdk/java/net/URL/PerConnectionProxy.java >> open/test/jdk/java/net/URLConnection/B5052093.java >> open/test/jdk/sun/net/www/AuthHeaderTest.java >> open/test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java > > Mahendra Chhipa has updated the pull request incrementally with one > additional commit since the last revision: > > Removed extra whitespace test/jdk/java/net/ProxySelector/LoopbackAddresses.java line 168: > 166: try(PrintWriter pw = new > PrintWriter(exchange.getResponseBody())) { > 167: pw.print("Hello ."); > 168: } I know that now UTF-8 is supposed to be the default - but I'd prefer to either make it explicit, or add a comment stating that since Java 18 PrintWriter will use UTF-8 encoding by default. test/jdk/java/net/ProxySelector/ProxyTest.java line 116: > 114: e.printStackTrace(); > 115: } > 116: try(PrintWriter pw = new > PrintWriter(exchange.getResponseBody())) { Same remark here test/jdk/java/net/URL/PerConnectionProxy.java line 234: > 232: } catch (IOException e) { > 233: } > 234: try(PrintWriter pw = new > PrintWriter(exchange.getResponseBody())) { And here too test/jdk/java/net/URLConnection/B5052093.java line 113: > 111: exchange.close(); > 112: } catch (IOException e) { > 113: e.printStackTrace(); Are you sure that this results in the same response headers than before? If I'm not mistaken here we will send both Content-Length and Transfer-Encoding: chunked. Was that what the previous server did, and what the test wants to test? test/jdk/sun/net/www/AuthHeaderTest.java line 139: > 137: void okReply (HttpExchange req) throws IOException { > 138: req.sendResponseHeaders (200, 0); > 139: try(PrintWriter pw = new PrintWriter(req.getResponseBody())) { Same remark about UTF-8 test/jdk/sun/net/www/AuthHeaderTest.java line 167: > 165: } > 166: } > 167: } missing newline at end of file? test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 157: > 155: } > 156: > 157: class SimpleHttpTransactionHandler implements HttpHandler the boolean `failed` should at least be volatile test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 178: > 176: responseBody[i] = 0x41; > 177: trans.sendResponseHeaders(200, 0); > 178: try(PrintWriter pw = new > PrintWriter(trans.getResponseBody())) { Same remark about UTF-8 here again test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 206: > 204: // override the Content-length header to be greater than > the actual response body > 205: trans.getResponseHeaders().set("Content-length", > Integer.toString(responseBody.length+1)); > 206: trans.sendResponseHeaders(200, 0); Here again we will be mixing Content-Length and chunked test/jdk/sun/net/www/http/KeepAliveCache/B5045306.java line 207: > 205: trans.getResponseHeaders().set("Content-length", > Integer.toString(responseBody.length+1)); > 206: trans.sendResponseHeaders(200, 0); > 207: try(PrintWriter pw = new > PrintWriter(trans.getResponseBody())) { Same remark for UTF-8 ------------- PR: https://git.openjdk.java.net/jdk/pull/7616