26 * @bug 8161157 |
26 * @bug 8161157 |
27 * @summary Test response body handlers/subscribers when there is no body |
27 * @summary Test response body handlers/subscribers when there is no body |
28 * @library /lib/testlibrary http2/server |
28 * @library /lib/testlibrary http2/server |
29 * @build jdk.testlibrary.SimpleSSLContext |
29 * @build jdk.testlibrary.SimpleSSLContext |
30 * @modules java.base/sun.net.www.http |
30 * @modules java.base/sun.net.www.http |
31 * jdk.incubator.httpclient/jdk.incubator.http.internal.common |
31 * java.net.http/java.net.http.internal.common |
32 * jdk.incubator.httpclient/jdk.incubator.http.internal.frame |
32 * java.net.http/java.net.http.internal.frame |
33 * jdk.incubator.httpclient/jdk.incubator.http.internal.hpack |
33 * java.net.http/java.net.http.internal.hpack |
34 * @run testng/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=all NoBodyPartOne |
34 * @run testng/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=all NoBodyPartOne |
35 */ |
35 */ |
36 |
36 |
37 import java.net.URI; |
37 import java.net.URI; |
38 import java.nio.file.Files; |
38 import java.nio.file.Files; |
39 import java.nio.file.Path; |
39 import java.nio.file.Path; |
40 import java.nio.file.Paths; |
40 import java.nio.file.Paths; |
41 import jdk.incubator.http.HttpClient; |
41 import java.net.http.HttpClient; |
42 import jdk.incubator.http.HttpRequest; |
42 import java.net.http.HttpRequest; |
43 import jdk.incubator.http.HttpResponse; |
43 import java.net.http.HttpResponse; |
44 import jdk.incubator.http.HttpResponse.BodyHandler; |
44 import java.net.http.HttpResponse.BodyHandler; |
45 import org.testng.annotations.Test; |
45 import org.testng.annotations.Test; |
46 import static java.nio.charset.StandardCharsets.UTF_8; |
46 import static java.nio.charset.StandardCharsets.UTF_8; |
47 import static jdk.incubator.http.HttpRequest.BodyPublisher.fromString; |
47 import static java.net.http.HttpRequest.BodyPublisher.fromString; |
48 import static jdk.incubator.http.HttpResponse.BodyHandler.asByteArray; |
48 import static java.net.http.HttpResponse.BodyHandler.asByteArray; |
49 import static jdk.incubator.http.HttpResponse.BodyHandler.asFile; |
49 import static java.net.http.HttpResponse.BodyHandler.asFile; |
50 import static jdk.incubator.http.HttpResponse.BodyHandler.asString; |
50 import static java.net.http.HttpResponse.BodyHandler.asString; |
51 import static org.testng.Assert.assertEquals; |
51 import static org.testng.Assert.assertEquals; |
52 import static org.testng.Assert.assertTrue; |
52 import static org.testng.Assert.assertTrue; |
53 |
53 |
54 public class NoBodyPartOne extends AbstractNoBody { |
54 public class NoBodyPartOne extends AbstractNoBody { |
55 |
55 |