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 jdk.attach
39 * jdk.jartool/sun.tools.jar
40 *
41 * @run build jdk.testlibrary.* 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();
62 throw t;
|