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, |