< prev index next >

test/lib/jdk/test/lib/cds/CDSTestUtils.java

Print this page

*** 1,7 **** /* ! * Copyright (c) 2017, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2019, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 562,573 **** } // ============================= Logging public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { long started = System.currentTimeMillis(); ! OutputAnalyzer output = new OutputAnalyzer(pb.start()); String outputFileNamePrefix = getTestName() + "-" + String.format("%04d", getNextLogCounter()) + "-" + logName; writeFile(getOutputFile(outputFileNamePrefix + ".stdout"), output.getStdout()); writeFile(getOutputFile(outputFileNamePrefix + ".stderr"), output.getStderr()); --- 562,577 ---- } // ============================= Logging public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { + return executeAndLog(pb.start(), logName); + } + + public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception { long started = System.currentTimeMillis(); ! OutputAnalyzer output = new OutputAnalyzer(process); String outputFileNamePrefix = getTestName() + "-" + String.format("%04d", getNextLogCounter()) + "-" + logName; writeFile(getOutputFile(outputFileNamePrefix + ".stdout"), output.getStdout()); writeFile(getOutputFile(outputFileNamePrefix + ".stderr"), output.getStderr());
< prev index next >