From 9b98a06f7d437c527d19194e0df54aaf63f84c4f Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Tue, 4 Aug 2015 18:11:40 +0300 Subject: [PATCH] 8132648: sun/tools/jhsdb/BasicLauncherTest fails with java.lang.RuntimeException Added check for standard conditions causing attach to fail Reviewed-by: jbachorik, sspitsyn --- jdk/test/sun/tools/jhsdb/BasicLauncherTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java index 4d7a81c152b..7111598d316 100644 --- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java +++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java @@ -42,6 +42,7 @@ import jdk.testlibrary.Utils; 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 class BasicLauncherTest { 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.