< prev index next >

test/hotspot/jtreg/runtime/appcds/sharedStrings/InvalidFileFormat.java

Print this page

        

*** 34,45 **** * @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; // 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. --- 34,46 ---- * @run main InvalidFileFormat * @run main/othervm -XX:+UseStringDeduplication InvalidFileFormat * @run main/othervm -XX:-CompactStrings InvalidFileFormat */ import java.io.File; + import jdk.test.lib.cds.CDSTestUtils; + import jdk.test.lib.process.OutputAnalyzer; // 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,72 **** System.out.println("Filename for testcase: " + dataFileName); OutputAnalyzer out = SharedStringsUtils.dumpWithoutChecks(TestCommon.list("HelloString"), "invalidFormat" + File.separator + dataFileName); ! if (!TestCommon.isUnableToMap(out)) out.shouldContain(expectedWarning).shouldHaveExitValue(1); } } --- 64,73 ---- System.out.println("Filename for testcase: " + dataFileName); OutputAnalyzer out = SharedStringsUtils.dumpWithoutChecks(TestCommon.list("HelloString"), "invalidFormat" + File.separator + dataFileName); ! CDSTestUtils.checkMappingFailure(out); out.shouldContain(expectedWarning).shouldHaveExitValue(1); } }
< prev index next >