test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java
changeset 54314 46cf212cdcca
parent 54086 ccb4a50bee06
child 55031 37a077319427
equal deleted inserted replaced
54313:440cbcf3b268 54314:46cf212cdcca
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug 6725892
    26  * @bug 6725892
       
    27  * @library /test/lib
    27  * @run main/othervm -Dsun.net.httpserver.maxReqTime=2 Test
    28  * @run main/othervm -Dsun.net.httpserver.maxReqTime=2 Test
    28  * @summary
    29  * @summary
    29  */
    30  */
    30 
    31 
    31 import com.sun.net.httpserver.*;
    32 import com.sun.net.httpserver.*;
    33 import java.util.concurrent.*;
    34 import java.util.concurrent.*;
    34 import java.util.logging.*;
    35 import java.util.logging.*;
    35 import java.io.*;
    36 import java.io.*;
    36 import java.net.*;
    37 import java.net.*;
    37 import javax.net.ssl.*;
    38 import javax.net.ssl.*;
       
    39 
       
    40 import jdk.test.lib.net.URIBuilder;
    38 
    41 
    39 public class Test {
    42 public class Test {
    40 
    43 
    41     static HttpServer s1;
    44     static HttpServer s1;
    42     static int port;
    45     static int port;
    74             s1.setExecutor(exec);
    77             s1.setExecutor(exec);
    75             s1.start();
    78             s1.start();
    76 
    79 
    77             port = s1.getAddress().getPort();
    80             port = s1.getAddress().getPort();
    78             System.out.println ("Server on port " + port);
    81             System.out.println ("Server on port " + port);
    79             url = new URL ("http://127.0.0.1:"+port+"/foo");
    82             url = URIBuilder.newBuilder()
       
    83                 .scheme("http")
       
    84                 .loopback()
       
    85                 .port(port)
       
    86                 .path("/foo")
       
    87                 .toURLUnchecked();
       
    88             System.out.println("URL: " + url);
    80             test1();
    89             test1();
    81             test2();
    90             test2();
    82             test3();
    91             test3();
    83             Thread.sleep (2000);
    92             Thread.sleep (2000);
    84         } catch (Exception e) {
    93         } catch (Exception e) {