< prev index next >
test/hotspot/jtreg/runtime/appcds/SpecifySysLoaderProp.java
Print this page
rev 49875 : [mq]: first.patch
*** 1,7 ****
/*
! * Copyright (c) 2014, 2017, 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) 2014, 2018, 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.
*** 22,32 ****
*
*/
/*
* @test
! * @summary If -Djava.system.class.loader=xxx is specified in command-line, disable UseAppCDS
* @requires vm.cds
* @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* @compile test-classes/TestClassLoader.java
--- 22,32 ----
*
*/
/*
* @test
! * @summary If -Djava.system.class.loader=xxx is specified in command-line, disable archived non-system classes
* @requires vm.cds
* @library /test/lib
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* @compile test-classes/TestClassLoader.java
*** 44,54 ****
JarBuilder.build("sysloader", "TestClassLoader", "ReportMyLoader", "TrySwitchMyLoader");
String jarFileName = "sysloader.jar";
String appJar = TestCommon.getTestJar(jarFileName);
TestCommon.testDump(appJar, TestCommon.list("ReportMyLoader"));
! String warning = "VM warning: UseAppCDS is disabled because the java.system.class.loader property is specified";
// (0) Baseline. Do not specify -Djava.system.class.loader
// The test class should be loaded from archive
TestCommon.run(
--- 44,54 ----
JarBuilder.build("sysloader", "TestClassLoader", "ReportMyLoader", "TrySwitchMyLoader");
String jarFileName = "sysloader.jar";
String appJar = TestCommon.getTestJar(jarFileName);
TestCommon.testDump(appJar, TestCommon.list("ReportMyLoader"));
! String warning = "VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified";
// (0) Baseline. Do not specify -Djava.system.class.loader
// The test class should be loaded from archive
TestCommon.run(
*** 68,78 ****
output.shouldContain(warning);
output.shouldContain("ClassNotFoundException: no.such.Klass");
});
// (2) Try to execute the archive with -Djava.system.class.loader=TestClassLoader,
! // it should run, but AppCDS should be disabled
TestCommon.run(
"-verbose:class",
"-cp", appJar,
"-Djava.system.class.loader=TestClassLoader",
"ReportMyLoader")
--- 68,78 ----
output.shouldContain(warning);
output.shouldContain("ClassNotFoundException: no.such.Klass");
});
// (2) Try to execute the archive with -Djava.system.class.loader=TestClassLoader,
! // it should run, but archived non-system classes should be disabled
TestCommon.run(
"-verbose:class",
"-cp", appJar,
"-Djava.system.class.loader=TestClassLoader",
"ReportMyLoader")
< prev index next >