< prev index next > test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java
Print this page
/*
! * Copyright (c) 2016, 2023, 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.
/*
! * Copyright (c) 2016, 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.
* questions.
*/
/*
* @test
! * @summary Module system initialization exception results if a module is specificed twice to --patch-module.
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @run driver PatchModuleDupModule
*/
* questions.
*/
/*
* @test
! * @summary If a module is specificed twice to --patch-module, it should print an error
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @run driver PatchModuleDupModule
*/
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public class PatchModuleDupModule {
- // The module system initialization should generate an ExceptionInInitializerError
// if --patch-module is specified with the same module more than once.
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"--patch-module=module_one=module_one_dir",
"--patch-module=module_one=module_one_dir",
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public class PatchModuleDupModule {
// if --patch-module is specified with the same module more than once.
+ // The launcher should print an error.
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
"--patch-module=module_one=module_one_dir",
"--patch-module=module_one=module_one_dir",
< prev index next >