--- old/test/runtime/SharedArchiveFile/DefaultUseWithClient.java 2017-04-13 19:31:03.503924519 -0700 +++ new/test/runtime/SharedArchiveFile/DefaultUseWithClient.java 2017-04-13 19:31:03.443924521 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,15 +31,13 @@ * @bug 8032224 */ -import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.cds.CDSTestUtils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; import java.io.File; public class DefaultUseWithClient { public static void main(String[] args) throws Exception { - String fileName = "DefaultUseWithClient.jsa"; - // On 32-bit windows CDS should be on by default in "-client" config // Skip this test on any other platform boolean is32BitWindows = (Platform.isWindows() && Platform.is32bit()); @@ -48,29 +46,7 @@ return; } - // create the archive - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./" + fileName, - "-Xshare:dump"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldHaveExitValue(0); - - pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./" + fileName, - "-client", - "-XX:+PrintSharedSpaces", - "-version"); - - output = new OutputAnalyzer(pb.start()); - try { - output.shouldContain("sharing"); - } catch (RuntimeException e) { - // if sharing failed due to ASLR or similar reasons, - // check whether sharing was attempted at all (UseSharedSpaces) - output.shouldContain("UseSharedSpaces:"); - } - output.shouldHaveExitValue(0); + CDSTestUtils.createArchiveAndCheck(); + CDSTestUtils.runWithArchiveAndCheck("-client", "-XX:+PrintSharedSpaces"); } }