jdk/test/com/sun/net/httpserver/Test9a.java
changeset 26206 fb87c4051d65
parent 23010 6dadb192ad81
equal deleted inserted replaced
26205:c073791a67de 26206:fb87c4051d65
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug 6270015
    26  * @bug 6270015
       
    27  * @library /lib/testlibrary/
       
    28  * @build jdk.testlibrary.SimpleSSLContext
    27  * @run main/othervm Test9a
    29  * @run main/othervm Test9a
    28  * @summary  Light weight HTTP server
    30  * @summary  Light weight HTTP server
    29  */
    31  */
    30 
    32 
    31 import com.sun.net.httpserver.*;
    33 import com.sun.net.httpserver.*;
    32 
    34 
    33 import java.util.concurrent.*;
    35 import java.util.concurrent.*;
    34 import java.io.*;
    36 import java.io.*;
    35 import java.net.*;
    37 import java.net.*;
    36 import javax.net.ssl.*;
    38 import javax.net.ssl.*;
       
    39 import jdk.testlibrary.SimpleSSLContext;
    37 
    40 
    38 /* Same as Test1 but requests run in parallel.
    41 /* Same as Test1 but requests run in parallel.
    39  */
    42  */
    40 
    43 
    41 public class Test9a extends Test {
    44 public class Test9a extends Test {
    54             server = HttpsServer.create (addr, 0);
    57             server = HttpsServer.create (addr, 0);
    55             HttpHandler h = new FileServerHandler (root);
    58             HttpHandler h = new FileServerHandler (root);
    56             HttpContext c1 = server.createContext ("/test1", h);
    59             HttpContext c1 = server.createContext ("/test1", h);
    57             executor = Executors.newCachedThreadPool();
    60             executor = Executors.newCachedThreadPool();
    58             server.setExecutor (executor);
    61             server.setExecutor (executor);
    59             serverCtx = new SimpleSSLContext(System.getProperty("test.src")).get();
    62             serverCtx = new SimpleSSLContext().get();
    60             clientCtx = new SimpleSSLContext(System.getProperty("test.src")).get();
    63             clientCtx = new SimpleSSLContext().get();
    61             server.setHttpsConfigurator(new HttpsConfigurator (serverCtx));
    64             server.setHttpsConfigurator(new HttpsConfigurator (serverCtx));
    62             server.start();
    65             server.start();
    63 
    66 
    64             int port = server.getAddress().getPort();
    67             int port = server.getAddress().getPort();
    65             error = false;
    68             error = false;