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

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


   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  * @build DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  30  * @run shell ../MakeJAR3.sh DummyAgent
  31  * @run main TestDaemonThreadLauncher /timeout=240
  32  *
  33  */
  34 import java.io.File;
  35 import java.net.URL;
  36 import java.net.URLClassLoader;
  37 
  38 public class TestDaemonThread implements Runnable{
  39     File classpath;
  40 
  41     public TestDaemonThread(File classpath) {
  42         this.classpath = classpath;
  43     }
  44 
  45     @Override
  46     public void run() {
  47 
  48 
  49         try {




   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  * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread
  30  * @run shell ../MakeJAR3.sh DummyAgent
  31  * @run main TestDaemonThreadLauncher /timeout=240
  32  *
  33  */
  34 import java.io.File;
  35 import java.net.URL;
  36 import java.net.URLClassLoader;
  37 
  38 public class TestDaemonThread implements Runnable{
  39     File classpath;
  40 
  41     public TestDaemonThread(File classpath) {
  42         this.classpath = classpath;
  43     }
  44 
  45     @Override
  46     public void run() {
  47 
  48 
  49         try {