test/hotspot/jtreg/runtime/appcds/jvmti/ClassFileLoadHookTest.java
changeset 54340 2221f042556d
parent 48469 7312ae4465d6
child 55060 b5ca5b98037b
equal deleted inserted replaced
54339:f69a2f675f19 54340:2221f042556d
     1 /*
     1 /*
     2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    25 /*
    25 /*
    26  * @test
    26  * @test
    27  * @summary Test jvmti class file loader hook interaction with AppCDS
    27  * @summary Test jvmti class file loader hook interaction with AppCDS
    28  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
    28  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
    29  * @requires vm.cds
    29  * @requires vm.cds
    30  * @modules java.base/jdk.internal.misc
       
    31  *          jdk.jartool/sun.tools.jar
       
    32  *          java.management
       
    33  * @build ClassFileLoadHook
    30  * @build ClassFileLoadHook
    34  * @run main/othervm/native ClassFileLoadHookTest
    31  * @run main/othervm/native ClassFileLoadHookTest
    35  */
    32  */
    36 
    33 
    37 
    34 
    44 public class ClassFileLoadHookTest {
    41 public class ClassFileLoadHookTest {
    45     public static String sharedClasses[] = {
    42     public static String sharedClasses[] = {
    46         "ClassFileLoadHook",
    43         "ClassFileLoadHook",
    47         "ClassFileLoadHook$TestCaseId",
    44         "ClassFileLoadHook$TestCaseId",
    48         "ClassFileLoadHook$1",
    45         "ClassFileLoadHook$1",
    49         "LoadMe"
    46         "LoadMe",
       
    47         "java/sql/SQLException"
    50     };
    48     };
    51 
    49 
    52     public static void main(String[] args) throws Exception {
    50     public static void main(String[] args) throws Exception {
    53         String wbJar =
    51         String wbJar =
    54             ClassFileInstaller.writeJar("WhiteBox.jar", "sun.hotspot.WhiteBox");
    52             ClassFileInstaller.writeJar("WhiteBox.jar", "sun.hotspot.WhiteBox");