test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ModulePathAndCP.java
changeset 54340 2221f042556d
parent 53636 962ed57b29c9
equal deleted inserted replaced
54339:f69a2f675f19 54340:2221f042556d
    91         Files.copy(mainJar, mainJar2);
    91         Files.copy(mainJar, mainJar2);
    92 
    92 
    93     }
    93     }
    94 
    94 
    95     public static void main(String... args) throws Exception {
    95     public static void main(String... args) throws Exception {
       
    96         run();
       
    97     }
       
    98 
       
    99     public static void run(String... extra_runtime_args) throws Exception {
    96         // compile the modules and create the modular jar files
   100         // compile the modules and create the modular jar files
    97         buildTestModule();
   101         buildTestModule();
    98         String appClasses[] = {MAIN_CLASS, APP_CLASS};
   102         String appClasses[] = {MAIN_CLASS, APP_CLASS};
    99         // create an archive with the classes in the modules built in the
   103         // create an archive with the classes in the modules built in the
   100         // previous step
   104         // previous step
   102                                         null, appClasses,
   106                                         null, appClasses,
   103                                         "--module-path", moduleDir.toString(),
   107                                         "--module-path", moduleDir.toString(),
   104                                         "-m", MAIN_MODULE);
   108                                         "-m", MAIN_MODULE);
   105         TestCommon.checkDump(output);
   109         TestCommon.checkDump(output);
   106         String prefix[] = {"-Djava.class.path=", "-Xlog:class+load=trace"};
   110         String prefix[] = {"-Djava.class.path=", "-Xlog:class+load=trace"};
       
   111         prefix = TestCommon.concat(prefix, extra_runtime_args);
   107 
   112 
   108         // run with the archive with the --module-path the same as the one during
   113         // run with the archive with the --module-path the same as the one during
   109         // dump time. The classes should be loaded from the archive.
   114         // dump time. The classes should be loaded from the archive.
   110         TestCommon.runWithModules(prefix,
   115         TestCommon.runWithModules(prefix,
   111                                   null, // --upgrade-module-path
   116                                   null, // --upgrade-module-path