< prev index next >

test/java/lang/instrument/DaemonThread/TestDaemonThread.java

Print this page
rev 16783 : 8176176: fix @modules in jdk_svc tests
Reviewed-by: duke


   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */

  24 /* @test
  25  * @bug 7142035
  26  * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown
  27  * @library /lib/testlibrary
  28  *

  29  * @modules java.instrument
  30  *          java.management

  31  * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  32  * @run shell ../MakeJAR3.sh DummyAgent
  33  * @run main/timeout=240 TestDaemonThreadLauncher
  34  *
  35  */
  36 import java.io.File;
  37 import java.net.URL;
  38 import java.net.URLClassLoader;
  39 
  40 public class TestDaemonThread implements Runnable{
  41     File classpath;
  42 
  43     public TestDaemonThread(File classpath) {
  44         this.classpath = classpath;
  45     }
  46 
  47     @Override
  48     public void run() {
  49 
  50 
  51         try {
  52             URL u = this.getClass().getClassLoader().getResource("DummyClass.class");
  53             String path = u.getPath();
  54             String parent = u.getPath().substring(0, path.lastIndexOf('/')+1);


   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /* @test
  26  * @bug 7142035
  27  * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown

  28  *
  29  * @library /lib/testlibrary
  30  * @modules java.instrument
  31  *          java.management
  32  *
  33  * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  34  * @run shell ../MakeJAR3.sh DummyAgent
  35  * @run main/timeout=240 TestDaemonThreadLauncher

  36  */
  37 import java.io.File;
  38 import java.net.URL;
  39 import java.net.URLClassLoader;
  40 
  41 public class TestDaemonThread implements Runnable{
  42     File classpath;
  43 
  44     public TestDaemonThread(File classpath) {
  45         this.classpath = classpath;
  46     }
  47 
  48     @Override
  49     public void run() {
  50 
  51 
  52         try {
  53             URL u = this.getClass().getClassLoader().getResource("DummyClass.class");
  54             String path = u.getPath();
  55             String parent = u.getPath().substring(0, path.lastIndexOf('/')+1);
< prev index next >