test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests

test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java

Print this page




  73         argsList.add("useAppLoader");
  74         String[] opts = new String[argsList.size()];
  75         opts = argsList.toArray(opts);
  76         TestCommon.run(opts).assertNormalExit("appLoader found method main");
  77 
  78         // case 2: load class in bootclasspath using boot loader
  79         argsList.remove(argsList.size() - 1);
  80         argsList.add("useBootLoader");
  81         opts = new String[argsList.size()];
  82         opts = argsList.toArray(opts);
  83         TestCommon.run(opts).assertNormalExit(EXPECTED_EXCEPTION);
  84 
  85         // case 3: load class in bootclasspath using app loader with '--limit-modules java.base'
  86         argsList.add(0, "--limit-modules");
  87         argsList.add(1, "java.base");
  88         argsList.remove(argsList.size() - 1);
  89         argsList.add("useAppLoader");
  90         opts = new String[argsList.size()];
  91         opts = argsList.toArray(opts);
  92         TestCommon.run(opts)
  93             .assertSilentlyDisabledCDS(out -> {
  94                 out.shouldHaveExitValue(0)
  95                    .shouldContain(EXPECTED_EXCEPTION);
  96             });
  97 
  98         // case 4: load class in bootclasspath using boot loader with '--limit-modules java.base'
  99         argsList.remove(argsList.size() - 1);
 100         argsList.add("useBootLoader");
 101         opts = new String[argsList.size()];
 102         opts = argsList.toArray(opts);
 103         TestCommon.run(opts)
 104             .assertSilentlyDisabledCDS(out -> {
 105                 out.shouldHaveExitValue(0)
 106                    .shouldContain(EXPECTED_EXCEPTION);
 107             });
 108     }
 109 }


  73         argsList.add("useAppLoader");
  74         String[] opts = new String[argsList.size()];
  75         opts = argsList.toArray(opts);
  76         TestCommon.run(opts).assertNormalExit("appLoader found method main");
  77 
  78         // case 2: load class in bootclasspath using boot loader
  79         argsList.remove(argsList.size() - 1);
  80         argsList.add("useBootLoader");
  81         opts = new String[argsList.size()];
  82         opts = argsList.toArray(opts);
  83         TestCommon.run(opts).assertNormalExit(EXPECTED_EXCEPTION);
  84 
  85         // case 3: load class in bootclasspath using app loader with '--limit-modules java.base'
  86         argsList.add(0, "--limit-modules");
  87         argsList.add(1, "java.base");
  88         argsList.remove(argsList.size() - 1);
  89         argsList.add("useAppLoader");
  90         opts = new String[argsList.size()];
  91         opts = argsList.toArray(opts);
  92         TestCommon.run(opts)
  93             .assertSilentlyDisabledCDS(0, EXPECTED_EXCEPTION);



  94 
  95         // case 4: load class in bootclasspath using boot loader with '--limit-modules java.base'
  96         argsList.remove(argsList.size() - 1);
  97         argsList.add("useBootLoader");
  98         opts = new String[argsList.size()];
  99         opts = argsList.toArray(opts);
 100         TestCommon.run(opts)
 101             .assertSilentlyDisabledCDS(0, EXPECTED_EXCEPTION);



 102     }
 103 }
test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File