< prev index next >

test/jdk/java/net/httpclient/RequestBodyTest.java

Print this page

 42 import java.util.List;
 43 import java.util.Optional;
 44 import java.util.concurrent.ConcurrentHashMap;
 45 import java.util.function.Consumer;
 46 import java.util.function.Supplier;
 47 import javax.net.ssl.SSLContext;
 48 import jdk.test.lib.util.FileUtils;
 49 import static java.lang.System.out;
 50 import static java.nio.charset.StandardCharsets.*;
 51 import static java.nio.file.StandardOpenOption.*;
 52 
 53 import org.testng.annotations.AfterTest;
 54 import org.testng.annotations.BeforeTest;
 55 import org.testng.annotations.DataProvider;
 56 import org.testng.annotations.Test;
 57 import static org.testng.Assert.*;
 58 
 59 /*
 60  * @test
 61  * @bug 8087112
 62  * @modules java.net.http
 63  *          java.logging
 64  *          jdk.httpserver
 65  * @library /test/lib
 66  * @compile ../../../com/sun/net/httpserver/LogFilter.java
 67  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
 68  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
 69  * @build jdk.test.lib.net.SimpleSSLContext
 70  * @build LightWeightHttpServer
 71  * @build jdk.test.lib.Platform
 72  * @build jdk.test.lib.util.FileUtils
 73  * @run testng/othervm RequestBodyTest
 74  * @run testng/othervm/java.security.policy=RequestBodyTest.policy RequestBodyTest
 75  */
 76 public class RequestBodyTest {
 77 
 78     static final String fileroot = System.getProperty("test.src", ".") + "/docs";
 79     static final String midSizedFilename = "/files/notsobigfile.txt";
 80     static final String smallFilename = "/files/smallfile.txt";
 81     final ConcurrentHashMap<String,Throwable> failures = new ConcurrentHashMap<>();
 82 
 83     HttpClient client;
 84     String httpURI;
 85     String httpsURI;
 86 
 87     enum RequestBody {
 88         BYTE_ARRAY,
 89         BYTE_ARRAY_OFFSET,

 42 import java.util.List;
 43 import java.util.Optional;
 44 import java.util.concurrent.ConcurrentHashMap;
 45 import java.util.function.Consumer;
 46 import java.util.function.Supplier;
 47 import javax.net.ssl.SSLContext;
 48 import jdk.test.lib.util.FileUtils;
 49 import static java.lang.System.out;
 50 import static java.nio.charset.StandardCharsets.*;
 51 import static java.nio.file.StandardOpenOption.*;
 52 
 53 import org.testng.annotations.AfterTest;
 54 import org.testng.annotations.BeforeTest;
 55 import org.testng.annotations.DataProvider;
 56 import org.testng.annotations.Test;
 57 import static org.testng.Assert.*;
 58 
 59 /*
 60  * @test
 61  * @bug 8087112
 62  * @modules java.net.http/jdk.internal.net.http.common
 63  *          java.logging
 64  *          jdk.httpserver
 65  * @library /test/lib /test/jdk/java/net/httpclient/lib
 66  * @compile ../../../com/sun/net/httpserver/LogFilter.java
 67  * @compile ../../../com/sun/net/httpserver/EchoHandler.java
 68  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
 69  * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.common.TestServerConfigurator
 70  * @build LightWeightHttpServer
 71  * @build jdk.test.lib.Platform
 72  * @build jdk.test.lib.util.FileUtils
 73  * @run testng/othervm RequestBodyTest
 74  * @run testng/othervm/java.security.policy=RequestBodyTest.policy RequestBodyTest
 75  */
 76 public class RequestBodyTest {
 77 
 78     static final String fileroot = System.getProperty("test.src", ".") + "/docs";
 79     static final String midSizedFilename = "/files/notsobigfile.txt";
 80     static final String smallFilename = "/files/smallfile.txt";
 81     final ConcurrentHashMap<String,Throwable> failures = new ConcurrentHashMap<>();
 82 
 83     HttpClient client;
 84     String httpURI;
 85     String httpsURI;
 86 
 87     enum RequestBody {
 88         BYTE_ARRAY,
 89         BYTE_ARRAY_OFFSET,
< prev index next >