< prev index next >

test/hotspot/jtreg/serviceability/logging/TestLogRotation.java

Print this page
rev 58959 : [mq]: 8243568

*** 25,35 **** * @test TestLogRotation.java * @summary test flags for log rotation * @library /test/lib * @modules java.base/jdk.internal.misc * java.management ! * @run main/othervm/timeout=600 TestLogRotation * */ import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.FilenameFilter; --- 25,35 ---- * @test TestLogRotation.java * @summary test flags for log rotation * @library /test/lib * @modules java.base/jdk.internal.misc * java.management ! * @run driver/timeout=600 TestLogRotation * */ import jdk.test.lib.process.ProcessTools; import java.io.File; import java.io.FilenameFilter;
*** 76,95 **** String[] logOpts = new String[]{ "-cp", System.getProperty("java.class.path"), "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles, "-XX:-DisableExplicitGC", // to ensure that System.gc() works "-Xmx128M"}; - // System.getProperty("test.java.opts") is '' if no options is set - // need to skip such empty - String[] externalVMopts = System.getProperty("test.java.opts").length() == 0 - ? new String[0] - : System.getProperty("test.java.opts").split(" "); - args.addAll(Arrays.asList(externalVMopts)); args.addAll(Arrays.asList(logOpts)); args.add(GCLoggingGenerator.class.getName()); args.add(String.valueOf(numberOfFiles * logFileSizeK * 1024)); ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[0])); pb.redirectErrorStream(true); pb.redirectOutput(new File(GCLoggingGenerator.class.getName() + ".log")); Process process = pb.start(); int result = process.waitFor(); if (result != 0) { --- 76,89 ---- String[] logOpts = new String[]{ "-cp", System.getProperty("java.class.path"), "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles, "-XX:-DisableExplicitGC", // to ensure that System.gc() works "-Xmx128M"}; args.addAll(Arrays.asList(logOpts)); args.add(GCLoggingGenerator.class.getName()); args.add(String.valueOf(numberOfFiles * logFileSizeK * 1024)); ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, args.toArray(String[]::new)); pb.redirectErrorStream(true); pb.redirectOutput(new File(GCLoggingGenerator.class.getName() + ".log")); Process process = pb.start(); int result = process.waitFor(); if (result != 0) {
< prev index next >