8132648: sun/tools/jhsdb/BasicLauncherTest fails with java.lang.RuntimeException

Added check for standard conditions causing attach to fail

Reviewed-by: jbachorik, sspitsyn
This commit is contained in:
Dmitry Samersoff 2015-08-04 18:11:40 +03:00
parent e4c4b49bdf
commit 9b98a06f7d

View File

@ -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.