117 return dump2(baseArchiveName, topArchiveName,
118 TestCommon.concat(wbRuntimeArgs(), cmdLineSuffix));
119 }
120
121 /**
122 * A convenience method similar to dump2, but always use the JDK's default archive
123 * as the base archive.
124 *
125 * Most dynamicArchive/*.java test cases should be using this method instead of run2.
126 */
127 public static Result dump(String topArchiveName, String ... cmdLineSuffix)
128 throws Exception
129 {
130 return dump2(null, topArchiveName, cmdLineSuffix);
131 }
132
133 /**
134 * Dump the base archive. The JDK's default class list is used (unless otherwise specified
135 * in cmdLineSuffix).
136 */
137 public static void dumpBaseArchive(String baseArchiveName, String ... cmdLineSuffix)
138 throws Exception
139 {
140 CDSOptions opts = new CDSOptions();
141 opts.setArchiveName(baseArchiveName);
142 opts.addSuffix(cmdLineSuffix);
143 opts.addSuffix("-Djava.class.path=");
144 OutputAnalyzer out = CDSTestUtils.createArchive(opts);
145 CDSTestUtils.checkDump(out);
146 }
147
148 /**
149 * Same as dumpBaseArchive, but also add WhiteBox to the bootcp
150 */
151 public static void dumpBaseArchive_WB(String baseArchiveName, String ... cmdLineSuffix)
152 throws Exception
153 {
154 dumpBaseArchive(baseArchiveName,
155 TestCommon.concat("-Xbootclasspath/a:" + getWhiteBoxJar(), cmdLineSuffix));
156 }
157
158 private static String getWhiteBoxJar() {
159 String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
160 if (!(new File(wbJar)).exists()) {
161 throw new RuntimeException("Test error: your test must have " +
162 "'@run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox'");
163 }
164 return wbJar;
165 }
|
117 return dump2(baseArchiveName, topArchiveName,
118 TestCommon.concat(wbRuntimeArgs(), cmdLineSuffix));
119 }
120
121 /**
122 * A convenience method similar to dump2, but always use the JDK's default archive
123 * as the base archive.
124 *
125 * Most dynamicArchive/*.java test cases should be using this method instead of run2.
126 */
127 public static Result dump(String topArchiveName, String ... cmdLineSuffix)
128 throws Exception
129 {
130 return dump2(null, topArchiveName, cmdLineSuffix);
131 }
132
133 /**
134 * Dump the base archive. The JDK's default class list is used (unless otherwise specified
135 * in cmdLineSuffix).
136 */
137 public static OutputAnalyzer dumpBaseArchive(String baseArchiveName, String ... cmdLineSuffix)
138 throws Exception
139 {
140 CDSOptions opts = new CDSOptions();
141 opts.setArchiveName(baseArchiveName);
142 opts.addSuffix(cmdLineSuffix);
143 opts.addSuffix("-Djava.class.path=");
144 OutputAnalyzer out = CDSTestUtils.createArchive(opts);
145 CDSTestUtils.checkDump(out);
146 return out;
147 }
148
149 /**
150 * Same as dumpBaseArchive, but also add WhiteBox to the bootcp
151 */
152 public static void dumpBaseArchive_WB(String baseArchiveName, String ... cmdLineSuffix)
153 throws Exception
154 {
155 dumpBaseArchive(baseArchiveName,
156 TestCommon.concat("-Xbootclasspath/a:" + getWhiteBoxJar(), cmdLineSuffix));
157 }
158
159 private static String getWhiteBoxJar() {
160 String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar");
161 if (!(new File(wbJar)).exists()) {
162 throw new RuntimeException("Test error: your test must have " +
163 "'@run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox'");
164 }
165 return wbJar;
166 }
|