< prev index next >

test/hotspot/jtreg/runtime/cds/jvmti/InstrumentationTest.java

Print this page




   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 /*
  26  * @test
  27  * @summary Exercise the java.lang.instrument.Instrumentation APIs on classes archived
  28  *          using CDS/AppCDSv1/AppCDSv2.
  29  * @library /test/lib /test/hotspot/jtreg/runtime/appcds /test/hotspot/jtreg/runtime/appcds/test-classes
  30  * @requires vm.cds
  31  * @requires vm.flavor != "minimal"
  32  * @build sun.hotspot.WhiteBox
  33  *        InstrumentationApp
  34  *        InstrumentationClassFileTransformer
  35  *        InstrumentationRegisterClassFileTransformer
  36  * @run main/othervm InstrumentationTest
  37  */
  38 
  39 // Note: TestCommon is from /test/hotspot/jtreg/runtime/appcds/TestCommon.java
  40 // Note: Util       is from /test/hotspot/jtreg/runtime/appcds/test-classes/TestCommon.java
  41 
  42 import com.sun.tools.attach.VirtualMachine;
  43 import java.io.File;
  44 import java.io.FileInputStream;
  45 import java.util.Scanner;
  46 import jdk.test.lib.Asserts;
  47 import jdk.test.lib.cds.CDSOptions;
  48 import jdk.test.lib.process.OutputAnalyzer;
  49 import jdk.test.lib.process.ProcessTools;
  50 
  51 public class InstrumentationTest {
  52     public static String bootClasses[] = {
  53         "InstrumentationApp$Intf",
  54         "InstrumentationApp$Bar",
  55         "sun.hotspot.WhiteBox",
  56     };
  57     public static String appClasses[] = {
  58         "InstrumentationApp",
  59         "InstrumentationApp$Foo",
  60         "InstrumentationApp$MyLoader",




   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 /*
  26  * @test
  27  * @summary Exercise the java.lang.instrument.Instrumentation APIs on classes archived
  28  *          using CDS/AppCDSv1/AppCDSv2.
  29  * @library /test/lib /test/hotspot/jtreg/runtime/cds /test/hotspot/jtreg/runtime/cds/test-classes
  30  * @requires vm.cds
  31  * @requires vm.flavor != "minimal"
  32  * @build sun.hotspot.WhiteBox
  33  *        InstrumentationApp
  34  *        InstrumentationClassFileTransformer
  35  *        InstrumentationRegisterClassFileTransformer
  36  * @run main/othervm InstrumentationTest
  37  */
  38 
  39 // Note: TestCommon is from /test/hotspot/jtreg/runtime/cds/TestCommon.java
  40 // Note: Util       is from /test/hotspot/jtreg/runtime/cds/test-classes/TestCommon.java
  41 
  42 import com.sun.tools.attach.VirtualMachine;
  43 import java.io.File;
  44 import java.io.FileInputStream;
  45 import java.util.Scanner;
  46 import jdk.test.lib.Asserts;
  47 import jdk.test.lib.cds.CDSOptions;
  48 import jdk.test.lib.process.OutputAnalyzer;
  49 import jdk.test.lib.process.ProcessTools;
  50 
  51 public class InstrumentationTest {
  52     public static String bootClasses[] = {
  53         "InstrumentationApp$Intf",
  54         "InstrumentationApp$Bar",
  55         "sun.hotspot.WhiteBox",
  56     };
  57     public static String appClasses[] = {
  58         "InstrumentationApp",
  59         "InstrumentationApp$Foo",
  60         "InstrumentationApp$MyLoader",


< prev index next >