8174915: Improve error handing for Jdp tests under sun/management/jdp
authorasapre
Tue, 21 Feb 2017 17:33:08 +0530
changeset 44004 5f1d97ac4595
parent 43995 20b18d22693a
child 44005 f485e38a4685
8174915: Improve error handing for Jdp tests under sun/management/jdp Summary: Added checks for abnormal exits of spawn process by test cases Reviewed-by: dholmes, dfuchs, sspitsyn Contributed-by: amit.sapre@oracle.com
jdk/test/sun/management/jdp/DynamicLauncher.java
jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
--- a/jdk/test/sun/management/jdp/DynamicLauncher.java	Thu Feb 16 15:48:40 2017 -0800
+++ b/jdk/test/sun/management/jdp/DynamicLauncher.java	Tue Feb 21 17:33:08 2017 +0530
@@ -58,6 +58,11 @@
                 }
             }
         } while (tryAgain);
+        output.shouldHaveExitValue(0);
+        // java.lang.Exception is thrown by JdpTestCase if something goes wrong
+        // for instance - see JdpTestCase::shutdown()
+        output.shouldNotContain("java.lang.Exception:");
+        output.shouldNotContain("Error: Could not find or load main class");
     }
 
     protected OutputAnalyzer runVM() throws Exception {
--- a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java	Thu Feb 16 15:48:40 2017 -0800
+++ b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java	Tue Feb 21 17:33:08 2017 +0530
@@ -40,7 +40,6 @@
     public static void main(String[] args) throws Exception {
         DynamicLauncher launcher = new JdpJmxRemoteDynamicPortTest();
         launcher.run();
-        launcher.getProcessOutpoutAnalyzer().stderrShouldNotContain("java.lang.Exception:");
     }
 
     protected String[] options() {