< prev index next >

test/hotspot/jtreg/runtime/appcds/DumpClassList.java

Print this page


  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 DumpLoadedClassList should exclude generated classes, classes in bootclasspath/a and
  28  *          --patch-module.
  29  * @requires vm.cds
  30  * @library /test/lib
  31  * @modules java.base/jdk.internal.misc
  32  *          jdk.jartool/sun.tools.jar
  33  * @compile test-classes/ArrayListTest.java
  34  * @run main DumpClassList
  35  */
  36 
  37 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 
  41 public class DumpClassList {
  42     public static void main(String[] args) throws Exception {
  43         // build The app
  44         String[] appClass = new String[] {"ArrayListTest"};
  45         String classList = "app.list";
  46 
  47         JarBuilder.build("app", appClass[0]);
  48         String appJar = TestCommon.getTestJar("app.jar");
  49 
  50         // build patch-module
  51         String source = "package java.lang; "                       +
  52                         "public class NewClass { "                  +
  53                         "    static { "                             +
  54                         "        System.out.println(\"NewClass\"); "+




  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 DumpLoadedClassList should exclude generated classes, classes in bootclasspath/a and
  28  *          --patch-module.
  29  * @requires vm.cds
  30  * @library /test/lib
  31  * @modules java.base/jdk.internal.misc
  32  *          jdk.jartool/sun.tools.jar
  33  * @compile test-classes/ArrayListTest.java
  34  * @run driver DumpClassList
  35  */
  36 
  37 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 
  41 public class DumpClassList {
  42     public static void main(String[] args) throws Exception {
  43         // build The app
  44         String[] appClass = new String[] {"ArrayListTest"};
  45         String classList = "app.list";
  46 
  47         JarBuilder.build("app", appClass[0]);
  48         String appJar = TestCommon.getTestJar("app.jar");
  49 
  50         // build patch-module
  51         String source = "package java.lang; "                       +
  52                         "public class NewClass { "                  +
  53                         "    static { "                             +
  54                         "        System.out.println(\"NewClass\"); "+


< prev index next >