< prev index next >

test/jdk/com/sun/tools/attach/PermissionTest.java

Print this page




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.sun.tools.attach.VirtualMachine;
  25 import com.sun.tools.attach.AttachNotSupportedException;
  26 import java.io.File;
  27 import jdk.test.lib.thread.ProcessThread;
  28 import jdk.test.lib.process.OutputAnalyzer;
  29 import jdk.test.lib.process.ProcessTools;
  30 
  31 /*
  32  * @test
  33  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  34  * @summary Basic unit tests for the VM attach mechanism. Unit test for Attach
  35  * API - this checks that a SecurityException is thrown as expected.
  36  *
  37  * @library /lib/testlibrary
  38  * @library /test/lib
  39  * @modules jdk.attach
  40  *          jdk.jartool/sun.tools.jar
  41  *
  42  * @run build jdk.testlibrary.* Application
  43  * @run main PermissionTest
  44  */
  45 public class PermissionTest {
  46 
  47     /*
  48      * The actual test is in the nested class TestMain.
  49      * The responsibility of this class is to:
  50      * 1. Start the Application class in a separate process.
  51      * 2. Find the pid and shutdown port of the running Application.
  52      * 3. Run the tests in TstMain that will attach to the Application.
  53      * 4. Shut down the Application.
  54      */
  55     public static void main(String args[]) throws Throwable {
  56         ProcessThread processThread = null;
  57         try {
  58             processThread = RunnerUtil.startApplication();
  59             runTests(processThread.getPid());
  60         } catch (Throwable t) {
  61             System.out.println("TestPermission got unexpected exception: " + t);
  62             t.printStackTrace();




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.sun.tools.attach.VirtualMachine;
  25 import com.sun.tools.attach.AttachNotSupportedException;
  26 import java.io.File;
  27 import jdk.test.lib.thread.ProcessThread;
  28 import jdk.test.lib.process.OutputAnalyzer;
  29 import jdk.test.lib.process.ProcessTools;
  30 
  31 /*
  32  * @test
  33  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  34  * @summary Basic unit tests for the VM attach mechanism. Unit test for Attach
  35  * API - this checks that a SecurityException is thrown as expected.
  36  *

  37  * @library /test/lib
  38  * @modules jdk.attach
  39  *          jdk.jartool/sun.tools.jar
  40  *
  41  * @run build Application
  42  * @run main PermissionTest
  43  */
  44 public class PermissionTest {
  45 
  46     /*
  47      * The actual test is in the nested class TestMain.
  48      * The responsibility of this class is to:
  49      * 1. Start the Application class in a separate process.
  50      * 2. Find the pid and shutdown port of the running Application.
  51      * 3. Run the tests in TstMain that will attach to the Application.
  52      * 4. Shut down the Application.
  53      */
  54     public static void main(String args[]) throws Throwable {
  55         ProcessThread processThread = null;
  56         try {
  57             processThread = RunnerUtil.startApplication();
  58             runTests(processThread.getPid());
  59         } catch (Throwable t) {
  60             System.out.println("TestPermission got unexpected exception: " + t);
  61             t.printStackTrace();


< prev index next >