test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/MismatchedPatchModule.java
changeset 54927 1512d88b24c6
parent 51990 6003e034cdd8
equal deleted inserted replaced
54926:d4e7ccaf1445 54927:1512d88b24c6
     1 /*
     1 /*
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2019, 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.
    72         output.shouldHaveExitValue(1)
    72         output.shouldHaveExitValue(1)
    73               .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module");
    73               .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module");
    74 
    74 
    75         // Case 2: --patch-module specified for run time but not for dump time
    75         // Case 2: --patch-module specified for run time but not for dump time
    76         System.out.println("Case 2: --patch-module specified for run time but not for dump time");
    76         System.out.println("Case 2: --patch-module specified for run time but not for dump time");
       
    77         String appJar = JarBuilder.build("PatchMain-app", "PatchMain");
    77         output =
    78         output =
    78             TestCommon.dump(null,
    79             TestCommon.dump(appJar,
    79                 TestCommon.list("javax/naming/spi/NamingManager"),
    80                 TestCommon.list("javax/naming/spi/NamingManager"),
    80                 "PatchMain", "javax.naming.spi.NamingManager");
    81                 "PatchMain", "javax.naming.spi.NamingManager");
    81         TestCommon.checkDump(output, "Loading classes to share");
    82         TestCommon.checkDump(output);
    82 
    83 
    83         // javax.naming.spi.NamingManager is patched at runtime
    84         // javax.naming.spi.NamingManager is patched at runtime
    84         TestCommon.run(
    85         TestCommon.run(
    85             "-XX:+UnlockDiagnosticVMOptions",
    86             "-XX:+UnlockDiagnosticVMOptions",
    86             "--patch-module=java.naming=" + moduleJar,
    87             "--patch-module=java.naming=" + moduleJar,