# HG changeset patch # User mchernov # Date 1461336555 -10800 # Node ID 21c37af5ba7ec4084c24c1ad97d1548917b4d65a # Parent 2ffb46735fecd17d4dc4faf123356b1fdd93a17c 8154759: [TESTBUG] GC tests should be changed to be able to execute with -Xlog:all=trace. Reviewed-by: jmasa, dfazunen diff -r 2ffb46735fec -r 21c37af5ba7e hotspot/test/gc/TestVerifySilently.java --- a/hotspot/test/gc/TestVerifySilently.java Fri Apr 22 17:46:06 2016 +0300 +++ b/hotspot/test/gc/TestVerifySilently.java Fri Apr 22 17:49:15 2016 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, 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 @@ -34,6 +34,7 @@ import jdk.test.lib.ProcessTools; import java.util.ArrayList; import java.util.Collections; +import jdk.test.lib.Utils; class RunSystemGC { public static void main(String args[]) throws Exception { @@ -43,19 +44,11 @@ public class TestVerifySilently { - private static String[] getTestJavaOpts() { - String testVmOptsStr = System.getProperty("test.java.opts"); - if (!testVmOptsStr.isEmpty()) { - return testVmOptsStr.split(" "); - } else { - return new String[] {}; - } - } private static OutputAnalyzer runTest(boolean verifySilently) throws Exception { ArrayList vmOpts = new ArrayList(); - Collections.addAll(vmOpts, getTestJavaOpts()); + Collections.addAll(vmOpts, Utils.getFilteredTestJavaOpts("-Xlog.*")); Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyDuringStartup", "-XX:+VerifyBeforeGC", diff -r 2ffb46735fec -r 21c37af5ba7e hotspot/test/gc/TestVerifySubSet.java --- a/hotspot/test/gc/TestVerifySubSet.java Fri Apr 22 17:46:06 2016 +0300 +++ b/hotspot/test/gc/TestVerifySubSet.java Fri Apr 22 17:49:15 2016 +0300 @@ -34,6 +34,7 @@ import jdk.test.lib.ProcessTools; import java.util.ArrayList; import java.util.Collections; +import jdk.test.lib.Utils; class RunSystemGC { public static void main(String args[]) throws Exception { @@ -42,19 +43,11 @@ } public class TestVerifySubSet { - private static String[] getTestJavaOpts() { - String testVmOptsStr = System.getProperty("test.java.opts"); - if (!testVmOptsStr.isEmpty()) { - return testVmOptsStr.split(" "); - } else { - return new String[] {}; - } - } private static OutputAnalyzer runTest(String subset) throws Exception { ArrayList vmOpts = new ArrayList(); - Collections.addAll(vmOpts, getTestJavaOpts()); + Collections.addAll(vmOpts, Utils.getFilteredTestJavaOpts("-Xlog.*")); Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyBeforeGC", "-XX:+VerifyAfterGC",