< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 141,28 ***
                  out.shouldHaveExitValue(0)
                     .shouldMatch("CDS is disabled when the.*option is specified")
                     .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
              });
  
!         boolean skippedTest = false;
!         if (!Compiler.isGraalEnabled()) {
!             // run with the archive with the --limit-modules option.
!             // CDS will be disabled with this options and the main class will be
!             // loaded from the modular jar.
!             TestCommon.run("-Xlog:class+load=trace",
!                            "-cp", destJar.toString(),
!                            "--limit-modules", "java.base," + TEST_MODULE1,
!                            "--module-path", moduleDir.toString(),
!                            "-m", TEST_MODULE1)
!                 .assertSilentlyDisabledCDS(out -> {
!                     out.shouldHaveExitValue(0)
!                        .shouldMatch("CDS is disabled when the.*option is specified")
-                        .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
-             });
-         } else {
-             skippedTest = true;
-         }
          // run with the archive with the --patch-module option.
          // CDS will be disabled with this options and the main class will be
          // loaded from the modular jar.
          TestCommon.run("-Xlog:class+load=trace",
                         "-cp", destJar.toString(),
--- 141,23 ---
                  out.shouldHaveExitValue(0)
                     .shouldMatch("CDS is disabled when the.*option is specified")
                     .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
              });
  
!         // run with the archive with the --limit-modules option.
!         // CDS will be disabled with this options and the main class will be
!         // loaded from the modular jar.
!         TestCommon.run("-Xlog:class+load=trace",
!                        "-cp", destJar.toString(),
!                        "--limit-modules", "java.base," + TEST_MODULE1,
!                        "--module-path", moduleDir.toString(),
!                        "-m", TEST_MODULE1)
!             .assertSilentlyDisabledCDS(out -> {
!                 out.shouldHaveExitValue(0)
!                    .shouldMatch("CDS is disabled when the.*option is specified")
!                    .shouldMatch(".class.load. com.simple.Main source:.*com.simple.jar");
!         });
          // run with the archive with the --patch-module option.
          // CDS will be disabled with this options and the main class will be
          // loaded from the modular jar.
          TestCommon.run("-Xlog:class+load=trace",
                         "-cp", destJar.toString(),

*** 241,11 ***
                                            "--module-path", longDirJar.toString(),
                                            "-m", TEST_MODULE1);
          if (output.getExitValue() != 0) {
              output.shouldMatch("os::stat error.*CDS dump aborted");
          }
- 
-         if (skippedTest) {
-             throw new SkippedException("Skipped --limit-modules test; it can't be run with Graal enabled");
-         }
      }
  }
--- 236,7 ---
< prev index next >