8132648: sun/tools/jhsdb/BasicLauncherTest fails with java.lang.RuntimeException
authordsamersoff
Tue, 04 Aug 2015 18:11:40 +0300
changeset 32217 56f5aebb508e
parent 32103 252be3ad6800
child 32218 c4a59b9f5c12
8132648: sun/tools/jhsdb/BasicLauncherTest fails with java.lang.RuntimeException Summary: Added check for standard conditions causing attach to fail Reviewed-by: jbachorik, sspitsyn
jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
--- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java	Mon Aug 03 15:31:29 2015 +0200
+++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java	Tue Aug 04 18:11:40 2015 +0300
@@ -42,6 +42,7 @@
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 import jdk.test.lib.apps.LingeredApp;
+import jdk.testlibrary.Platform;
 
 public class BasicLauncherTest {
 
@@ -131,10 +132,16 @@
     public static void main(String[] args)
         throws IOException {
 
+        if (!Platform.shouldSAAttach()) {
+            // Silently skip the test if we don't have enough permissions to attach
+            System.err.println("Error! Insufficient permissions to attach.");
+            return;
+        }
+
         launchCLHSDB();
 
         launch("No deadlocks found", "jstack");
-        launch("Server compiler detected", "jmap");
+        launch("compiler detected", "jmap");
         launch("Java System Properties", "jinfo");
 
         // The test throws RuntimeException on error.