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 NoBodyPartTwo |
34 * @run testng/othervm -Djdk.internal.httpclient.debug=true -Djdk.httpclient.HttpClient.log=all NoBodyPartTwo |
35 */ |
35 */ |
36 |
36 |
37 import java.io.InputStream; |
37 import java.io.InputStream; |
38 import java.net.URI; |
38 import java.net.URI; |
39 import java.util.Optional; |
39 import java.util.Optional; |
40 import java.util.function.Consumer; |
40 import java.util.function.Consumer; |
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 org.testng.annotations.Test; |
44 import org.testng.annotations.Test; |
45 import static jdk.incubator.http.HttpRequest.BodyPublisher.fromString; |
45 import static java.net.http.HttpRequest.BodyPublisher.fromString; |
46 import static jdk.incubator.http.HttpResponse.BodyHandler.asByteArray; |
46 import static java.net.http.HttpResponse.BodyHandler.asByteArray; |
47 import static jdk.incubator.http.HttpResponse.BodyHandler.asByteArrayConsumer; |
47 import static java.net.http.HttpResponse.BodyHandler.asByteArrayConsumer; |
48 import static jdk.incubator.http.HttpResponse.BodyHandler.asInputStream; |
48 import static java.net.http.HttpResponse.BodyHandler.asInputStream; |
49 import static jdk.incubator.http.HttpResponse.BodyHandler.buffering; |
49 import static java.net.http.HttpResponse.BodyHandler.buffering; |
50 import static jdk.incubator.http.HttpResponse.BodyHandler.replace; |
50 import static java.net.http.HttpResponse.BodyHandler.replace; |
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 import static org.testng.Assert.fail; |
53 import static org.testng.Assert.fail; |
54 |
54 |
55 public class NoBodyPartTwo extends AbstractNoBody { |
55 public class NoBodyPartTwo extends AbstractNoBody { |