# HG changeset patch # User jbachorik # Date 1449245949 0 # Node ID 445881c8c46ee584ade99828c0447d0c058637bb # Parent 5b74061eb1bb8c464ba5fb9ef2b13d943438df35# Parent 2dab71a665234f089059765a283da0ab7a76df17 Merge diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java --- a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java Fri Dec 04 16:19:09 2015 +0000 @@ -23,20 +23,22 @@ import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.ProcessTools; +import jdk.test.lib.process.ProcessTools; /* * @test * @summary Test of diagnostic command GC.run_finalization * @library /testlibrary + * @library /test/lib/share/classes * @modules java.base/sun.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* + * @build jdk.test.lib.process.* * @build RunFinalizationTest FinalizationRunner * @run main RunFinalizationTest */ @@ -50,8 +52,21 @@ javaArgs.add(TEST_APP_NAME); ProcessBuilder testAppPb = ProcessTools.createJavaProcessBuilder(javaArgs.toArray(new String[javaArgs.size()])); - OutputAnalyzer out = ProcessTools.executeProcess(testAppPb); - out.stderrShouldNotMatch("^" + FinalizationRunner.FAILED + ".*") - .stdoutShouldMatch("^" + FinalizationRunner.PASSED + ".*"); + final AtomicBoolean failed = new AtomicBoolean(); + final AtomicBoolean passed = new AtomicBoolean(); + + Process runner = ProcessTools.startProcess( + "FinalizationRunner", + testAppPb, + l -> { + failed.compareAndSet(false, l.contains(FinalizationRunner.FAILED)); + passed.compareAndSet(false, l.contains(FinalizationRunner.PASSED)); + } + ); + runner.waitFor(); + + if (failed.get() || !passed.get()) { + throw new Error("RunFinalizationTest failed"); + } } } diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/Asserts.java --- a/hotspot/test/testlibrary/jdk/test/lib/Asserts.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/Asserts.java Fri Dec 04 16:19:09 2015 +0000 @@ -41,7 +41,10 @@ * multiple times, then the line number won't provide enough context to * understand the failure. * + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib} */ +@Deprecated public class Asserts { /** diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java --- a/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java Fri Dec 04 16:19:09 2015 +0000 @@ -27,6 +27,11 @@ import java.nio.file.Path; import java.nio.file.Paths; +/** + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib} + */ +@Deprecated public final class JDKToolFinder { private JDKToolFinder() { diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java --- a/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java Fri Dec 04 16:19:09 2015 +0000 @@ -46,7 +46,10 @@ * Process p = pb.start(); * } * + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib} */ +@Deprecated public class JDKToolLauncher { private final String executable; private final List vmArgs = new ArrayList(); diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java --- a/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java Fri Dec 04 16:19:09 2015 +0000 @@ -41,7 +41,11 @@ * * @param process Process to analyze * @throws IOException If an I/O error occurs. + * + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib/process} */ + @Deprecated public OutputAnalyzer(Process process) throws IOException { OutputBuffer output = ProcessTools.getOutput(process); exitValue = process.exitValue(); diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java --- a/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java Fri Dec 04 16:19:09 2015 +0000 @@ -23,6 +23,11 @@ package jdk.test.lib; +/** + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib/process} + */ +@Deprecated public class OutputBuffer { private final String stdout; private final String stderr; diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/Platform.java --- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java Fri Dec 04 16:19:09 2015 +0000 @@ -25,6 +25,11 @@ import java.util.regex.Pattern; +/** + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib} + */ +@Deprecated public class Platform { private static final String osName = System.getProperty("os.name"); private static final String dataModel = System.getProperty("sun.arch.data.model"); diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java --- a/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java Fri Dec 04 16:19:09 2015 +0000 @@ -31,6 +31,11 @@ import java.util.Collections; import java.util.List; +/** + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib/process} + */ +@Deprecated public final class ProcessTools { private ProcessTools() { diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java --- a/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java Fri Dec 04 16:19:09 2015 +0000 @@ -27,6 +27,11 @@ import java.io.InputStream; import java.io.IOException; +/** + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib/process} + */ +@Deprecated public final class StreamPumper implements Runnable { private static final int BUF_SIZE = 256; diff -r 5b74061eb1bb -r 445881c8c46e hotspot/test/testlibrary/jdk/test/lib/Utils.java --- a/hotspot/test/testlibrary/jdk/test/lib/Utils.java Fri Dec 04 13:39:59 2015 +0300 +++ b/hotspot/test/testlibrary/jdk/test/lib/Utils.java Fri Dec 04 16:19:09 2015 +0000 @@ -55,7 +55,11 @@ /** * Common library for various test helper functions. + * + * @deprecated This class is deprecated. Use the one from + * {@code /test/lib/share/classes/jdk/test/lib} */ +@Deprecated public final class Utils { /**