< prev index next >
test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java
Print this page
*** 24,34 ****
/*
* @test
* @bug 8087112 8177935
* @library /lib/testlibrary server
* @build jdk.testlibrary.SimpleSSLContext
! * @modules jdk.incubator.httpclient/jdk.incubator.http.internal.common
* jdk.incubator.httpclient/jdk.incubator.http.internal.frame
* jdk.incubator.httpclient/jdk.incubator.http.internal.hpack
* @run testng/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors FixedThreadPoolTest
*/
--- 24,35 ----
/*
* @test
* @bug 8087112 8177935
* @library /lib/testlibrary server
* @build jdk.testlibrary.SimpleSSLContext
! * @modules java.base/sun.net.www.http
! * jdk.incubator.httpclient/jdk.incubator.http.internal.common
* jdk.incubator.httpclient/jdk.incubator.http.internal.frame
* jdk.incubator.httpclient/jdk.incubator.http.internal.hpack
* @run testng/othervm -Djdk.httpclient.HttpClient.log=ssl,requests,responses,errors FixedThreadPoolTest
*/
*** 37,48 ****
import static jdk.incubator.http.HttpClient.Version.HTTP_2;
import javax.net.ssl.*;
import java.nio.file.*;
import java.util.concurrent.*;
import jdk.testlibrary.SimpleSSLContext;
! import static jdk.incubator.http.HttpRequest.BodyProcessor.fromFile;
! import static jdk.incubator.http.HttpRequest.BodyProcessor.fromString;
import static jdk.incubator.http.HttpResponse.BodyHandler.asFile;
import static jdk.incubator.http.HttpResponse.BodyHandler.asString;
import org.testng.annotations.Test;
--- 38,49 ----
import static jdk.incubator.http.HttpClient.Version.HTTP_2;
import javax.net.ssl.*;
import java.nio.file.*;
import java.util.concurrent.*;
import jdk.testlibrary.SimpleSSLContext;
! import static jdk.incubator.http.HttpRequest.BodyPublisher.fromFile;
! import static jdk.incubator.http.HttpRequest.BodyPublisher.fromString;
import static jdk.incubator.http.HttpResponse.BodyHandler.asFile;
import static jdk.incubator.http.HttpResponse.BodyHandler.asString;
import org.testng.annotations.Test;
*** 79,89 ****
e.printStackTrace();
throw e;
}
}
! @Test(timeOut=3000000)
public static void test() throws Exception {
try {
initialize();
simpleTest(false);
simpleTest(true);
--- 80,90 ----
e.printStackTrace();
throw e;
}
}
! @Test
public static void test() throws Exception {
try {
initialize();
simpleTest(false);
simpleTest(true);
*** 102,111 ****
--- 103,119 ----
}
static HttpClient getClient() {
if (client == null) {
exec = Executors.newCachedThreadPool();
+ // Executor e1 = Executors.newFixedThreadPool(1);
+ // Executor e = (Runnable r) -> e1.execute(() -> {
+ // System.out.println("[" + Thread.currentThread().getName()
+ // + "] Executing: "
+ // + r.getClass().getName());
+ // r.run();
+ // });
client = HttpClient.newBuilder()
.executor(Executors.newFixedThreadPool(2))
.sslContext(sslContext)
.version(HTTP_2)
.build();
< prev index next >