14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
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.testlibrary.OutputAnalyzer;
28 import jdk.testlibrary.ProcessTools;
29 import jdk.testlibrary.ProcessThread;
30
31 /*
32 * @test
33 * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
34 * @summary Basic unit tests for the VM attach mechanism.
35 * @modules jdk.jartool/sun.tools.jar
36 * @library /lib/testlibrary
37 * @modules java.management
38 * jdk.attach
39 * jdk.jartool/sun.tools.jar
40 * @run build jdk.testlibrary.* Application
41 * @run main PermissionTest
42 *
43 * Unit test for Attach API -
44 * this checks that a SecurityException is thrown as expected.
45 */
46 public class PermissionTest {
47
48 /*
49 * The actual test is in the nested class TestMain.
50 * The responsibility of this class is to:
51 * 1. Start the Application class in a separate process.
52 * 2. Find the pid and shutdown port of the running Application.
53 * 3. Run the tests in TstMain that will attach to the Application.
54 * 4. Shut down the Application.
55 */
56 public static void main(String args[]) throws Throwable {
57 ProcessThread processThread = null;
58 try {
59 processThread = RunnerUtil.startApplication();
60 runTests(processThread.getPid());
61 } catch (Throwable t) {
62 System.out.println("TestPermission got unexpected exception: " + t);
63 t.printStackTrace();
64 throw t;
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
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.testlibrary.OutputAnalyzer;
28 import jdk.testlibrary.ProcessTools;
29 import jdk.testlibrary.ProcessThread;
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 * @modules java.management
39 * 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();
63 throw t;
|