106 Files.write(file, generateClass(i));
107 }
108
109 Path mainFile = SRC_DIR.resolve(MAIN_CLASS_NAME + ".java");
110 Files.write(mainFile, generateMainClass());
111
112 CDSJarUtils.buildFromSourceDirectory(
113 APP_JAR.toString(),
114 SRC_DIR.toString()
115 );
116 }
117
118 // Step 2. Try to dump the archive.
119 {
120 OutputAnalyzer output = TestCommon.createArchive(
121 APP_JAR.toString(),
122 listAppClasses(),
123 // Verification for lots of classes slows down the test.
124 "-XX:+IgnoreUnrecognizedVMOptions",
125 "-XX:+UnlockDiagnosticVMOptions",
126 "-XX:-VerifyDependencies",
127 "-XX:-VerifyBeforeExit"
128 );
129 TestCommon.checkDump(output);
130 }
131
132 // Step 3. Try to run, touching every class.
133 {
134 TestCommon.run(
135 // Verification for lots of classes slows down the test.
136 "-XX:+IgnoreUnrecognizedVMOptions",
137 "-XX:+UnlockDiagnosticVMOptions",
138 "-XX:-VerifyDependencies",
139 "-XX:-VerifyBeforeExit",
140 "-cp", APP_JAR.toString(),
141 MAIN_CLASS_NAME).
142 assertNormalExit("Success");
143 }
144
145 }
|
106 Files.write(file, generateClass(i));
107 }
108
109 Path mainFile = SRC_DIR.resolve(MAIN_CLASS_NAME + ".java");
110 Files.write(mainFile, generateMainClass());
111
112 CDSJarUtils.buildFromSourceDirectory(
113 APP_JAR.toString(),
114 SRC_DIR.toString()
115 );
116 }
117
118 // Step 2. Try to dump the archive.
119 {
120 OutputAnalyzer output = TestCommon.createArchive(
121 APP_JAR.toString(),
122 listAppClasses(),
123 // Verification for lots of classes slows down the test.
124 "-XX:+IgnoreUnrecognizedVMOptions",
125 "-XX:+UnlockDiagnosticVMOptions",
126 "-XX:-ArchiveLoaderLookupCache", // LEYDEN_ONLY - work around JDK-8365959
127 "-XX:-VerifyDependencies",
128 "-XX:-VerifyBeforeExit"
129 );
130 TestCommon.checkDump(output);
131 }
132
133 // Step 3. Try to run, touching every class.
134 {
135 TestCommon.run(
136 // Verification for lots of classes slows down the test.
137 "-XX:+IgnoreUnrecognizedVMOptions",
138 "-XX:+UnlockDiagnosticVMOptions",
139 "-XX:-VerifyDependencies",
140 "-XX:-VerifyBeforeExit",
141 "-cp", APP_JAR.toString(),
142 MAIN_CLASS_NAME).
143 assertNormalExit("Success");
144 }
145
146 }
|