25 * @test |
25 * @test |
26 * @bug 8087112 8159814 |
26 * @bug 8087112 8159814 |
27 * @library /lib/testlibrary server |
27 * @library /lib/testlibrary server |
28 * @build jdk.testlibrary.SimpleSSLContext |
28 * @build jdk.testlibrary.SimpleSSLContext |
29 * @modules java.base/sun.net.www.http |
29 * @modules java.base/sun.net.www.http |
30 * jdk.incubator.httpclient/jdk.incubator.http.internal.common |
30 * java.net.http/java.net.http.internal.common |
31 * jdk.incubator.httpclient/jdk.incubator.http.internal.frame |
31 * java.net.http/java.net.http.internal.frame |
32 * jdk.incubator.httpclient/jdk.incubator.http.internal.hpack |
32 * java.net.http/java.net.http.internal.hpack |
33 * @run testng/othervm -Djdk.httpclient.HttpClient.log=errors,requests,responses ServerPush |
33 * @run testng/othervm -Djdk.httpclient.HttpClient.log=errors,requests,responses ServerPush |
34 */ |
34 */ |
35 |
35 |
36 import java.io.*; |
36 import java.io.*; |
37 import java.net.*; |
37 import java.net.*; |
38 import java.nio.ByteBuffer; |
38 import java.nio.ByteBuffer; |
39 import java.nio.file.*; |
39 import java.nio.file.*; |
40 import jdk.incubator.http.*; |
40 import java.net.http.*; |
41 import jdk.incubator.http.HttpResponse.BodyHandler; |
41 import java.net.http.HttpResponse.BodyHandler; |
42 import jdk.incubator.http.HttpResponse.BodySubscriber; |
42 import java.net.http.HttpResponse.BodySubscriber; |
43 import jdk.incubator.http.HttpResponse.PushPromiseHandler; |
43 import java.net.http.HttpResponse.PushPromiseHandler; |
44 import java.util.*; |
44 import java.util.*; |
45 import java.util.concurrent.*; |
45 import java.util.concurrent.*; |
46 import java.util.function.Consumer; |
46 import java.util.function.Consumer; |
47 import java.util.function.UnaryOperator; |
47 import java.util.function.UnaryOperator; |
48 import org.testng.annotations.AfterTest; |
48 import org.testng.annotations.AfterTest; |
49 import org.testng.annotations.BeforeTest; |
49 import org.testng.annotations.BeforeTest; |
50 import org.testng.annotations.Test; |
50 import org.testng.annotations.Test; |
51 import static java.nio.charset.StandardCharsets.UTF_8; |
51 import static java.nio.charset.StandardCharsets.UTF_8; |
52 import static jdk.incubator.http.HttpResponse.BodyHandler.asByteArrayConsumer; |
52 import static java.net.http.HttpResponse.BodyHandler.asByteArrayConsumer; |
53 import static jdk.incubator.http.HttpResponse.BodyHandler.asFile; |
53 import static java.net.http.HttpResponse.BodyHandler.asFile; |
54 import static jdk.incubator.http.HttpResponse.BodyHandler.asString; |
54 import static java.net.http.HttpResponse.BodyHandler.asString; |
55 import static org.testng.Assert.*; |
55 import static org.testng.Assert.*; |
56 |
56 |
57 |
57 |
58 public class ServerPush { |
58 public class ServerPush { |
59 |
59 |