changeset 12683:a08b835d32ba

8134420: sun/tools/jps/TestJpsClass fails with java.lang.RuntimeException: The line 'line 2' does not match pattern '^\\d+\\s+.*': expected true, was false Reviewed-by: sla, dsamersoff
author jbachorik
date Fri, 04 Sep 2015 12:18:03 +0200
parents de451d90c53e
children ca461a33aa8b
files src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java test/ProblemList.txt test/sun/tools/jps/JpsBase.java test/sun/tools/jps/JpsHelper.java
diffstat 4 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java	Fri Sep 04 09:31:47 2015 -0700
+++ b/src/jdk.jcmd/share/classes/sun/tools/jps/Jps.java	Fri Sep 04 12:18:03 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -106,7 +106,11 @@
                         errorString = " -- jvm args information unavailable";
                         String jvmArgs = MonitoredVmUtil.jvmArgs(vm);
                         if (jvmArgs != null && jvmArgs.length() > 0) {
-                          output.append(' ').append(jvmArgs);
+                          output.append(' ')
+                            .append(
+                                // multi-line args are permitted
+                                jvmArgs.replace("\n", "\\n").replace("\r", "\\r")
+                            );
                         }
                     }
                     if (arguments.showVmFlags()) {
--- a/test/ProblemList.txt	Fri Sep 04 09:31:47 2015 -0700
+++ b/test/ProblemList.txt	Fri Sep 04 12:18:03 2015 +0200
@@ -387,11 +387,6 @@
 # 6456333
 sun/tools/jps/TestJpsJarRelative.java				generic-all
 
-# 8134420
-sun/tools/jps/TestJpsClass.java				generic-all
-sun/tools/jps/TestJpsJar.java					generic-all
-sun/tools/jps/TestJpsSanity.java				generic-all
-
 # 6734748
 sun/tools/jinfo/JInfoRunningProcessFlagTest.java		generic-all
 
--- a/test/sun/tools/jps/JpsBase.java	Fri Sep 04 09:31:47 2015 -0700
+++ b/test/sun/tools/jps/JpsBase.java	Fri Sep 04 12:18:03 2015 +0200
@@ -138,6 +138,8 @@
         String tmp = str.replace("\\", "\\\\");
         tmp = tmp.replace("+", "\\+");
         tmp = tmp.replace(".", "\\.");
+        tmp = tmp.replace("\n", "\\\\n");
+        tmp = tmp.replace("\r", "\\\\r");
         return tmp;
     }
 
--- a/test/sun/tools/jps/JpsHelper.java	Fri Sep 04 09:31:47 2015 -0700
+++ b/test/sun/tools/jps/JpsHelper.java	Fri Sep 04 12:18:03 2015 +0200
@@ -97,7 +97,10 @@
      * VM arguments to start test application with.
      * -XX:+UsePerfData is required for running the tests on embedded platforms.
      */
-    public static final String[] VM_ARGS = {"-XX:+UsePerfData", "-Xmx512m", "-XX:+PrintGCDetails"};
+    public static final String[] VM_ARGS = {
+        "-XX:+UsePerfData", "-Xmx512m", "-XX:+PrintGCDetails",
+        "-Dmultiline.prop=value1\nvalue2\r\nvalue3"
+    };
     /**
      * VM flag to start test application with
      */