jdk/test/java/net/URLClassLoader/closetest/CloseTest.java
changeset 42764 5f368ec0cbb4
parent 38883 d5de564f8089
child 45285 7f8db2139152
equal deleted inserted replaced
42763:31a6badb98e8 42764:5f368ec0cbb4
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /**
    24 /*
    25  * @test
    25  * @test
    26  * @bug 4167874
    26  * @bug 4167874
    27  * @modules jdk.httpserver
    27  * @modules java.logging
       
    28  *          jdk.httpserver
    28  * @library ../../../../com/sun/net/httpserver
    29  * @library ../../../../com/sun/net/httpserver
    29  * @library /lib/testlibrary
    30  * @library /lib/testlibrary
    30  * @build FileServerHandler jdk.testlibrary.FileUtils
    31  * @build FileServerHandler jdk.testlibrary.FileUtils
    31  * @run shell build.sh
    32  * @run shell build.sh
    32  * @run main/othervm CloseTest
    33  * @run main/othervm CloseTest
    33  * @summary URL-downloaded jar files can consume all available file descriptors
    34  * @summary URL-downloaded jar files can consume all available file descriptors
    34  */
    35  */
    35 
    36 
    36 import java.io.*;
    37 import java.io.File;
    37 import java.net.*;
    38 import java.lang.reflect.Method;
    38 import java.lang.reflect.*;
    39 import java.net.URLClassLoader;
    39 import com.sun.net.httpserver.*;
    40 import java.net.InetSocketAddress;
       
    41 import java.net.URL;
       
    42 import com.sun.net.httpserver.HttpContext;
       
    43 import com.sun.net.httpserver.HttpServer;
    40 
    44 
    41 public class CloseTest extends Common {
    45 public class CloseTest extends Common {
    42 
    46 
    43 //
    47 //
    44 // needs two jar files test1.jar and test2.jar with following structure
    48 // needs two jar files test1.jar and test2.jar with following structure
   128         }
   132         }
   129 
   133 
   130         // load tests
   134         // load tests
   131         loadClass ("com.foo.TestClass1", loader, false);
   135         loadClass ("com.foo.TestClass1", loader, false);
   132         loadClass ("com.foo.TestClass", loader, true);
   136         loadClass ("com.foo.TestClass", loader, true);
   133         loadClass ("java.sql.Array", loader, true);
   137         loadClass ("java.util.ArrayList", loader, true);
   134 
   138 
   135         // now check we can delete the path
   139         // now check we can delete the path
   136         rm_minus_rf (new File(name));
   140         rm_minus_rf (new File(name));
   137         System.out.println (" ... OK");
   141         System.out.println (" ... OK");
   138     }
   142     }