8154759: [TESTBUG] GC tests should be changed to be able to execute with -Xlog:all=trace.
authormchernov
Fri, 22 Apr 2016 17:49:15 +0300
changeset 38084 21c37af5ba7e
parent 38083 2ffb46735fec
child 38085 795e6a867668
8154759: [TESTBUG] GC tests should be changed to be able to execute with -Xlog:all=trace. Reviewed-by: jmasa, dfazunen
hotspot/test/gc/TestVerifySilently.java
hotspot/test/gc/TestVerifySubSet.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<String> vmOpts = new ArrayList();
 
-    Collections.addAll(vmOpts, getTestJavaOpts());
+    Collections.addAll(vmOpts, Utils.getFilteredTestJavaOpts("-Xlog.*"));
     Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions",
                                              "-XX:+VerifyDuringStartup",
                                              "-XX:+VerifyBeforeGC",
--- 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<String> vmOpts = new ArrayList();
 
-        Collections.addAll(vmOpts, getTestJavaOpts());
+        Collections.addAll(vmOpts, Utils.getFilteredTestJavaOpts("-Xlog.*"));
         Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions",
                                                  "-XX:+VerifyBeforeGC",
                                                  "-XX:+VerifyAfterGC",