10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8136930
27 * @summary Test that the VM ignores explicitly specified module internal properties.
28 * @modules java.base/jdk.internal.misc
29 * @library /test/lib
30 */
31
32 import jdk.test.lib.process.OutputAnalyzer;
33 import jdk.test.lib.process.ProcessTools;
34
35 // Test that the VM ignores module related properties such as "jdk.module.addmods"
36 // and jdk.module.addreads.0" that can only be set using module options.
37 public class IgnoreModulePropertiesTest {
38
39 // Test that the specified property and its value are ignored. If the VM accepted
40 // the property and value then an exception would be thrown because the value is
41 // bogus for that property. But, since the property is ignored no exception is
42 // thrown.
43 public static void testProperty(String prop, String value) throws Exception {
44 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
45 "-D" + prop + "=" + value, "-version");
46 OutputAnalyzer output = new OutputAnalyzer(pb.start());
47 output.shouldContain(" version ");
48 output.shouldHaveExitValue(0);
49
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8136930
27 * @summary Test that the VM ignores explicitly specified module internal properties.
28 * @modules java.base/jdk.internal.misc
29 * @library /test/lib
30 * @run driver IgnoreModulePropertiesTest
31 */
32
33 import jdk.test.lib.process.OutputAnalyzer;
34 import jdk.test.lib.process.ProcessTools;
35
36 // Test that the VM ignores module related properties such as "jdk.module.addmods"
37 // and jdk.module.addreads.0" that can only be set using module options.
38 public class IgnoreModulePropertiesTest {
39
40 // Test that the specified property and its value are ignored. If the VM accepted
41 // the property and value then an exception would be thrown because the value is
42 // bogus for that property. But, since the property is ignored no exception is
43 // thrown.
44 public static void testProperty(String prop, String value) throws Exception {
45 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
46 "-D" + prop + "=" + value, "-version");
47 OutputAnalyzer output = new OutputAnalyzer(pb.start());
48 output.shouldContain(" version ");
49 output.shouldHaveExitValue(0);
50
|