< prev index next >
test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java
Print this page
@@ -34,12 +34,14 @@
* @run main InvalidFileFormat
* @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat
* @run main/othervm -XX:-CompactStrings InvalidFileFormat
*/
-import jdk.test.lib.process.OutputAnalyzer;
import java.io.File;
+import jdk.test.lib.cds.CDSTestUtils;
+import jdk.test.lib.process.OutputAnalyzer;
+import jtreg.SkippedException;
// Checking most common error use cases
// This file is not an exhastive test of various shared data file corruption
// Note on usability intent: the shared data file is created and handled by
// the previledge person in the server environment.
@@ -63,10 +65,13 @@
System.out.println("Filename for testcase: " + dataFileName);
OutputAnalyzer out = SharedStringsUtils.dumpWithoutChecks(TestCommon.list("HelloString"),
"invalidFormat" + File.separator + dataFileName);
- if (!TestCommon.isUnableToMap(out))
+ if (CDSTestUtils.isUnableToMap(out)) {
+ throw new SkippedException(CDSTestUtils.UnableToMapMsg);
+ } else {
out.shouldContain(expectedWarning).shouldHaveExitValue(1);
}
+ }
}
< prev index next >