diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index 58645d3a49eff..5dceac0afbdee 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -40,7 +40,8 @@ public class CDSTestUtils { "UseSharedSpaces: Unable to allocate region, range is not within java heap."; public static final String MSG_RANGE_ALREADT_IN_USE = "Unable to allocate region, java heap range is already in use."; - + public static final String MSG_DYNAMIC_NOT_SUPPORTED = + "DynamicDumpSharedSpaces is unsupported when base CDS archive is not loaded"; public static final boolean DYNAMIC_DUMP = Boolean.getBoolean("test.dynamic.cds.archive"); public interface Checker { @@ -352,17 +353,8 @@ public static void checkCommonExecExceptions(OutputAnalyzer output) throws Excep // could also improve usability in the field. public static boolean isUnableToMap(OutputAnalyzer output) { String outStr = output.getOutput(); - if ((output.getExitValue() == 1) && ( - outStr.contains("Unable to reserve shared space at required address") || - outStr.contains("Unable to map ReadOnly shared space at required address") || - outStr.contains("Unable to map ReadWrite shared space at required address") || - outStr.contains("Unable to map MiscData shared space at required address") || - outStr.contains("Unable to map MiscCode shared space at required address") || - outStr.contains("Unable to map OptionalData shared space at required address") || - outStr.contains("Could not allocate metaspace at a compatible address") || - outStr.contains("UseSharedSpaces: Unable to allocate region, range is not within java heap") || - outStr.contains("DynamicDumpSharedSpaces is unsupported when base CDS archive is not loaded") )) - { + if ((output.getExitValue() == 1) && + (outStr.contains(MSG_RANGE_NOT_WITHIN_HEAP) || outStr.contains(MSG_DYNAMIC_NOT_SUPPORTED))) { return true; }