test/jdk/java/net/CookieHandler/CookieManagerTest.java
changeset 58108 5302477c8285
parent 55399 46049b8a5658
child 58679 9c3209ff7550
equal deleted inserted replaced
58106:79186d82463e 58108:5302477c8285
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @summary Unit test for java.net.CookieManager
    26  * @summary Unit test for java.net.CookieManager
    27  * @bug 6244040 7150552 7051862
    27  * @bug 6244040 7150552 7051862
    28  * @modules jdk.httpserver
    28  * @modules jdk.httpserver
    29  * @run main/othervm -ea CookieManagerTest
    29  *          java.logging
       
    30  * @run main/othervm -ea -esa CookieManagerTest
    30  * @author Edward Wang
    31  * @author Edward Wang
    31  */
    32  */
    32 
    33 
    33 import com.sun.net.httpserver.*;
    34 import com.sun.net.httpserver.*;
    34 import java.util.Collections;
    35 import java.util.Collections;
    35 import java.util.LinkedList;
    36 import java.util.LinkedList;
    36 import java.util.List;
    37 import java.util.List;
    37 import java.io.IOException;
    38 import java.io.IOException;
    38 import java.net.*;
    39 import java.net.*;
       
    40 import java.util.logging.Level;
       
    41 import java.util.logging.Logger;
    39 import static java.net.Proxy.NO_PROXY;
    42 import static java.net.Proxy.NO_PROXY;
    40 
    43 
    41 public class CookieManagerTest {
    44 public class CookieManagerTest {
    42 
    45 
    43     static CookieTransactionHandler httpTrans;
    46     static CookieTransactionHandler httpTrans;
    61         System.out.println("Using: \"" + loopback.getHostAddress() + "\"");
    64         System.out.println("Using: \"" + loopback.getHostAddress() + "\"");
    62         return loopback.getHostAddress();
    65         return loopback.getHostAddress();
    63     }
    66     }
    64 
    67 
    65     public static void main(String[] args) throws Exception {
    68     public static void main(String[] args) throws Exception {
       
    69         // logs everything...
       
    70         Logger root = Logger.getLogger("");
       
    71         root.setLevel(Level.ALL);
       
    72         root.getHandlers()[0].setLevel(Level.ALL);
       
    73 
    66         startHttpServer();
    74         startHttpServer();
    67         makeHttpCall();
    75         makeHttpCall();
    68 
    76 
    69         if (httpTrans.badRequest) {
    77         if (httpTrans.badRequest) {
    70             throw new RuntimeException("Test failed : bad cookie header");
    78             throw new RuntimeException("Test failed : bad cookie header");