test/hotspot/jtreg/runtime/appcds/HelloExtTest.java
changeset 48979 514c73a1955b
parent 48791 6e079ff6c83c
child 49894 c830e94b5606
equal deleted inserted replaced
48978:93996c47d36f 48979:514c73a1955b
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2018, 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.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 /*
    25 /*
    26  * @test
    26  * @test
    27  * @summary a simple test for loading a class using the ext class loader in AppCDS
    27  * @summary a simple test for loading a class using the platform class loader
       
    28  *          (which used to be called the "extension loader) in AppCDS
    28  * @requires vm.cds
    29  * @requires vm.cds
    29  * @library /test/lib
    30  * @library /test/lib
    30  * @modules java.base/jdk.internal.misc
    31  * @modules java.base/jdk.internal.misc
    31  *          java.management
    32  *          java.management
    32  *          jdk.jartool/sun.tools.jar
    33  *          jdk.jartool/sun.tools.jar
    51 
    52 
    52     TestCommon.dump(appJar,
    53     TestCommon.dump(appJar,
    53         TestCommon.list("org/omg/CORBA/ORB", "[Ljava/lang/Comparable;"),
    54         TestCommon.list("org/omg/CORBA/ORB", "[Ljava/lang/Comparable;"),
    54         bootClassPath, "-verbose:class", "--add-modules", "java.corba");
    55         bootClassPath, "-verbose:class", "--add-modules", "java.corba");
    55 
    56 
    56     OutputAnalyzer output = TestCommon.execCommon("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
       
    57         "-cp", appJar, bootClassPath, "-verbose:class", "--add-modules", "java.corba", "HelloExt");
       
    58 
       
    59     String prefix = ".class.load. ";
    57     String prefix = ".class.load. ";
    60     String class_pattern = ".*LambdaForm[$]MH[/][0123456789].*";
    58     String class_pattern = ".*LambdaForm[$]MH[/][0123456789].*";
    61     String suffix = ".*source: shared objects file.*";
    59     String suffix = ".*source: shared objects file.*";
    62     String pattern = prefix + class_pattern + suffix;
    60     String pattern = prefix + class_pattern + suffix;
    63     output.shouldNotMatch(pattern);
       
    64 
    61 
    65     output = TestCommon.execCommon("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
    62     TestCommon.run("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
    66         "-cp", appJar, bootClassPath, "-verbose:class",
    63             "-cp", appJar, bootClassPath, "-verbose:class", "--add-modules", "java.corba", "HelloExt")
    67         "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary",
    64         .assertNormalExit(output -> output.shouldNotMatch(pattern));
    68         "--add-modules", "java.corba", "HelloExt");
    65 
    69     output.shouldNotMatch(class_pattern);
    66 
       
    67     TestCommon.run("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
       
    68             "-cp", appJar, bootClassPath, "-verbose:class",
       
    69             "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary",
       
    70             "--add-modules", "java.corba", "HelloExt")
       
    71         .assertNormalExit(output ->  output.shouldNotMatch(class_pattern));
    70   }
    72   }
    71 }
    73 }