< prev index next >
test/hotspot/jtreg/runtime/appcds/UseAppCDS.java
Print this page
*** 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.
*** 120,137 ****
return classes;
}
static void dumpLoadedClasses(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
! true,
"-XX:DumpLoadedClassList=" + CLASSLIST_FILE,
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
TESTNAME,
! TEST_OUT);
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-loaded-classes")
.shouldHaveExitValue(0).shouldContain(TEST_OUT);
List<String> dumpedClasses = toClassNames(CLASSLIST_FILE);
--- 120,137 ----
return classes;
}
static void dumpLoadedClasses(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
! TestCommon.makeCommandLineForAppCDS(
"-XX:DumpLoadedClassList=" + CLASSLIST_FILE,
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
TESTNAME,
! TEST_OUT));
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-loaded-classes")
.shouldHaveExitValue(0).shouldContain(TEST_OUT);
List<String> dumpedClasses = toClassNames(CLASSLIST_FILE);
*** 150,170 ****
}
}
static void dumpArchive(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
! true,
useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" :
"-XX:+UnlockDiagnosticVMOptions",
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
"-XX:SharedClassListFile=" + CLASSLIST_FILE,
"-XX:SharedArchiveFile=" + ARCHIVE_FILE,
"-Xlog:cds",
! "-Xshare:dump");
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive")
.shouldHaveExitValue(0);
for (String clazz : expectedClasses) {
--- 150,170 ----
}
}
static void dumpArchive(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
! TestCommon.makeCommandLineForAppCDS(
useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" :
"-XX:+UnlockDiagnosticVMOptions",
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
"-XX:SharedClassListFile=" + CLASSLIST_FILE,
"-XX:SharedArchiveFile=" + ARCHIVE_FILE,
"-Xlog:cds",
! "-Xshare:dump"));
OutputAnalyzer output = TestCommon.executeAndLog(pb, "dump-archive")
.shouldHaveExitValue(0);
for (String clazz : expectedClasses) {
*** 177,198 ****
}
}
static void useArchive(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
! true,
useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" :
"-XX:+UnlockDiagnosticVMOptions",
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
"-XX:SharedArchiveFile=" + ARCHIVE_FILE,
"-verbose:class",
"-Xshare:on",
TESTNAME,
! TEST_OUT );
OutputAnalyzer output = TestCommon.executeAndLog(pb, "use-archive");
if (CDSTestUtils.isUnableToMap(output))
System.out.println("Unable to map: test case skipped");
else
--- 177,198 ----
}
}
static void useArchive(boolean useAppCDS, String[] expectedClasses,
String[] unexpectedClasses) throws Exception {
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
! TestCommon.makeCommandLineForAppCDS(
useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" :
"-XX:+UnlockDiagnosticVMOptions",
"-cp",
TESTJAR,
useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",
"-XX:SharedArchiveFile=" + ARCHIVE_FILE,
"-verbose:class",
"-Xshare:on",
TESTNAME,
! TEST_OUT));
OutputAnalyzer output = TestCommon.executeAndLog(pb, "use-archive");
if (CDSTestUtils.isUnableToMap(output))
System.out.println("Unable to map: test case skipped");
else
< prev index next >