< prev index next >

test/jdk/java/net/URLClassLoader/closetest/CloseTest.java

Print this page
rev 51881 : [mq]: 8211171
rev 51882 : [mq]: 8211171-1


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4167874
  27  * @modules java.logging
  28  *          jdk.httpserver
  29  *          jdk.compiler
  30  * @library ../../../../com/sun/net/httpserver
  31  *          /lib/testlibrary
  32  *          /test/lib
  33  * @build jdk.test.lib.compiler.CompilerUtils
  34  *        jdk.test.lib.util.FileUtils

  35  *        jdk.test.lib.Platform
  36  *        FileServerHandler JarUtils
  37  * @run main/othervm CloseTest
  38  * @summary URL-downloaded jar files can consume all available file descriptors
  39  */
  40 
  41 import java.io.File;
  42 import java.io.IOException;
  43 import java.lang.reflect.Method;
  44 import java.net.URLClassLoader;
  45 import java.net.InetSocketAddress;
  46 import java.net.URL;
  47 import java.nio.file.Files;
  48 import java.nio.file.Path;
  49 import java.nio.file.Paths;
  50 
  51 import jdk.test.lib.compiler.CompilerUtils;

  52 
  53 import com.sun.net.httpserver.HttpContext;
  54 import com.sun.net.httpserver.HttpServer;
  55 
  56 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
  57 
  58 public class CloseTest extends Common {
  59     private static final String WORK_DIR = System.getProperty("user.dir")
  60             + "/";
  61 //
  62 // needs two jar files test1.jar and test2.jar with following structure
  63 //
  64 // com/foo/TestClass
  65 // com/foo/TestClass1
  66 // com/foo/Resource1
  67 // com/foo/Resource2
  68 //
  69 // and a directory hierarchy with the same structure/contents
  70 
  71     public static void main(String args[]) throws Exception {




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 4167874
  27  * @modules java.logging
  28  *          jdk.httpserver
  29  *          jdk.compiler
  30  * @library ../../../../com/sun/net/httpserver

  31  *          /test/lib
  32  * @build jdk.test.lib.compiler.CompilerUtils
  33  *        jdk.test.lib.util.FileUtils
  34  *        jdk.test.lib.util.JarUtils
  35  *        jdk.test.lib.Platform
  36  *        FileServerHandler
  37  * @run main/othervm CloseTest
  38  * @summary URL-downloaded jar files can consume all available file descriptors
  39  */
  40 
  41 import java.io.File;
  42 import java.io.IOException;
  43 import java.lang.reflect.Method;
  44 import java.net.URLClassLoader;
  45 import java.net.InetSocketAddress;
  46 import java.net.URL;
  47 import java.nio.file.Files;
  48 import java.nio.file.Path;
  49 import java.nio.file.Paths;
  50 
  51 import jdk.test.lib.compiler.CompilerUtils;
  52 import jdk.test.lib.util.JarUtils;
  53 
  54 import com.sun.net.httpserver.HttpContext;
  55 import com.sun.net.httpserver.HttpServer;
  56 
  57 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
  58 
  59 public class CloseTest extends Common {
  60     private static final String WORK_DIR = System.getProperty("user.dir")
  61             + "/";
  62 //
  63 // needs two jar files test1.jar and test2.jar with following structure
  64 //
  65 // com/foo/TestClass
  66 // com/foo/TestClass1
  67 // com/foo/Resource1
  68 // com/foo/Resource2
  69 //
  70 // and a directory hierarchy with the same structure/contents
  71 
  72     public static void main(String args[]) throws Exception {


< prev index next >