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

Print this page
rev 9529 : 8034960: Serviceability tests using @library failing with java.lang.NoClassDefFoundError


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  * @library ../../../../com/sun/net/httpserver
  28  * @library /lib/testlibrary
  29  * @build FileServerHandler jdk.testlibrary.FileUtils
  30  * @run shell build.sh
  31  * @run main/othervm CloseTest
  32  * @summary URL-downloaded jar files can consume all available file descriptors
  33  */
  34 
  35 import java.io.*;
  36 import java.net.*;
  37 import java.lang.reflect.*;
  38 import com.sun.net.httpserver.*;
  39 
  40 public class CloseTest extends Common {
  41 
  42 //
  43 // needs two jar files test1.jar and test2.jar with following structure
  44 //
  45 // com/foo/TestClass
  46 // com/foo/TestClass1
  47 // com/foo/Resource1
  48 // com/foo/Resource2
  49 //




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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  * @library ../../../../com/sun/net/httpserver
  28  * @library /lib/testlibrary
  29  * @build jdk.testlibrary.* FileServerHandler
  30  * @run shell build.sh
  31  * @run main/othervm CloseTest
  32  * @summary URL-downloaded jar files can consume all available file descriptors
  33  */
  34 
  35 import java.io.*;
  36 import java.net.*;
  37 import java.lang.reflect.*;
  38 import com.sun.net.httpserver.*;
  39 
  40 public class CloseTest extends Common {
  41 
  42 //
  43 // needs two jar files test1.jar and test2.jar with following structure
  44 //
  45 // com/foo/TestClass
  46 // com/foo/TestClass1
  47 // com/foo/Resource1
  48 // com/foo/Resource2
  49 //