jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
changeset 32217 56f5aebb508e
parent 32019 6e305dc99cc8
child 33832 7dde7a271492
equal deleted inserted replaced
32103:252be3ad6800 32217:56f5aebb508e
    40 import jdk.testlibrary.JDKToolLauncher;
    40 import jdk.testlibrary.JDKToolLauncher;
    41 import jdk.testlibrary.Utils;
    41 import jdk.testlibrary.Utils;
    42 import jdk.testlibrary.OutputAnalyzer;
    42 import jdk.testlibrary.OutputAnalyzer;
    43 import jdk.testlibrary.ProcessTools;
    43 import jdk.testlibrary.ProcessTools;
    44 import jdk.test.lib.apps.LingeredApp;
    44 import jdk.test.lib.apps.LingeredApp;
       
    45 import jdk.testlibrary.Platform;
    45 
    46 
    46 public class BasicLauncherTest {
    47 public class BasicLauncherTest {
    47 
    48 
    48     private final static String toolName = "jhsdb";
    49     private final static String toolName = "jhsdb";
    49     private static LingeredApp theApp = null;
    50     private static LingeredApp theApp = null;
   129     }
   130     }
   130 
   131 
   131     public static void main(String[] args)
   132     public static void main(String[] args)
   132         throws IOException {
   133         throws IOException {
   133 
   134 
       
   135         if (!Platform.shouldSAAttach()) {
       
   136             // Silently skip the test if we don't have enough permissions to attach
       
   137             System.err.println("Error! Insufficient permissions to attach.");
       
   138             return;
       
   139         }
       
   140 
   134         launchCLHSDB();
   141         launchCLHSDB();
   135 
   142 
   136         launch("No deadlocks found", "jstack");
   143         launch("No deadlocks found", "jstack");
   137         launch("Server compiler detected", "jmap");
   144         launch("compiler detected", "jmap");
   138         launch("Java System Properties", "jinfo");
   145         launch("Java System Properties", "jinfo");
   139 
   146 
   140         // The test throws RuntimeException on error.
   147         // The test throws RuntimeException on error.
   141         // IOException is thrown if LingeredApp can't start because of some bad
   148         // IOException is thrown if LingeredApp can't start because of some bad
   142         // environment condition
   149         // environment condition