< prev index next >

test/hotspot/jtreg/runtime/cds/jigsaw/classpathtests/DummyClassesInBootClassPath.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 /*
  26  * @test
  27  * @summary Ensure that classes found in jimage takes precedence over classes found in -Xbootclasspath/a.
  28  * @requires vm.cds
  29  * @library /test/lib /test/hotspot/jtreg/runtime/appcds
  30  * @modules java.compiler
  31  *          jdk.jartool/sun.tools.jar
  32  * @compile ../../test-classes/DummyClassHelper.java
  33  * @compile ../../test-classes/java/net/HttpCookie.jasm
  34  * @compile ../../../SharedArchiveFile/javax/annotation/processing/FilerException.jasm
  35  * @build sun.hotspot.WhiteBox
  36  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  37  * @run driver DummyClassesInBootClassPath
  38  */
  39 
  40 import java.io.File;
  41 import java.util.List;
  42 import java.util.ArrayList;
  43 import jdk.test.lib.process.OutputAnalyzer;
  44 
  45 public class DummyClassesInBootClassPath {
  46     private static final String METHOD_NAME = "thisClassIsDummy()";
  47 
  48     static void checkOutput(OutputAnalyzer output, String[] classNames) throws Exception {
  49         for (int i = 0; i < classNames.length; i++) {
  50             String cn = classNames[i].replace('/', '.');
  51             TestCommon.checkExec(output,
  52                 "java.lang.NoSuchMethodException: " + cn + "." +
  53                 METHOD_NAME);
  54             output.shouldNotContain(cn + ".class should be in shared space.");




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 /*
  26  * @test
  27  * @summary Ensure that classes found in jimage takes precedence over classes found in -Xbootclasspath/a.
  28  * @requires vm.cds
  29  * @library /test/lib /test/hotspot/jtreg/runtime/cds
  30  * @modules java.compiler
  31  *          jdk.jartool/sun.tools.jar
  32  * @compile ../../test-classes/DummyClassHelper.java
  33  * @compile ../../test-classes/java/net/HttpCookie.jasm
  34  * @compile ../../../cds/javax/annotation/processing/FilerException.jasm
  35  * @build sun.hotspot.WhiteBox
  36  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  37  * @run driver DummyClassesInBootClassPath
  38  */
  39 
  40 import java.io.File;
  41 import java.util.List;
  42 import java.util.ArrayList;
  43 import jdk.test.lib.process.OutputAnalyzer;
  44 
  45 public class DummyClassesInBootClassPath {
  46     private static final String METHOD_NAME = "thisClassIsDummy()";
  47 
  48     static void checkOutput(OutputAnalyzer output, String[] classNames) throws Exception {
  49         for (int i = 0; i < classNames.length; i++) {
  50             String cn = classNames[i].replace('/', '.');
  51             TestCommon.checkExec(output,
  52                 "java.lang.NoSuchMethodException: " + cn + "." +
  53                 METHOD_NAME);
  54             output.shouldNotContain(cn + ".class should be in shared space.");


< prev index next >