< 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,47 ---- * @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; + 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,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); } } --- 65,77 ---- System.out.println("Filename for testcase: " + dataFileName); OutputAnalyzer out = SharedStringsUtils.dumpWithoutChecks(TestCommon.list("HelloString"), "invalidFormat" + File.separator + dataFileName); ! if (CDSTestUtils.isUnableToMap(out)) { ! throw new SkippedException(CDSTestUtils.UnableToMapMsg); ! } else { out.shouldContain(expectedWarning).shouldHaveExitValue(1); } + } }
< prev index next >