8132648: sun/tools/jhsdb/BasicLauncherTest fails with java.lang.RuntimeException
Summary: Added check for standard conditions causing attach to fail
Reviewed-by: jbachorik, sspitsyn
--- 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.