< prev index next >

test/com/sun/tools/attach/BasicTests.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung
   1 /*
   2  * Copyright (c) 2005, 2011, 2013 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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.*;
  25 import java.net.ServerSocket;
  26 import java.net.Socket;
  27 import java.io.IOException;
  28 import java.util.Properties;
  29 import java.util.List;
  30 import java.io.File;
  31 import jdk.testlibrary.OutputAnalyzer;
  32 import jdk.testlibrary.JDKToolLauncher;
  33 import jdk.testlibrary.ProcessTools;
  34 import jdk.testlibrary.ProcessThread;
  35 
  36 /*
  37  * @test
  38  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  39  * @summary Basic unit tests for the VM attach mechanism.
  40  * @library /lib/testlibrary



  41  * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
  42  * @run main BasicTests
  43  *
  44  * This test will perform a number of basic attach tests.
  45  */
  46 public class BasicTests {
  47 
  48     /*
  49      * The actual test is in the nested class TestMain.
  50      * The responsibility of this class is to:
  51      * 1. Build all needed jars.
  52      * 2. Start the Application class in a separate process.
  53      * 3. Find the pid and shutdown port of the running Application.
  54      * 4. Launches the tests in nested class TestMain that will attach to the Application.
  55      * 5. Shut down the Application.
  56      */
  57     public static void main(String args[]) throws Throwable {
  58         ProcessThread processThread = null;
  59         try {
  60             buildJars();


   1 /*
   2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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.*;
  25 import java.net.ServerSocket;
  26 import java.net.Socket;
  27 import java.io.IOException;
  28 import java.util.Properties;
  29 import java.util.List;
  30 import java.io.File;
  31 import jdk.testlibrary.OutputAnalyzer;
  32 import jdk.testlibrary.JDKToolLauncher;
  33 import jdk.testlibrary.ProcessTools;
  34 import jdk.testlibrary.ProcessThread;
  35 
  36 /*
  37  * @test
  38  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  39  * @summary Basic unit tests for the VM attach mechanism.
  40  * @library /lib/testlibrary
  41  * @modules java.instrument
  42  *          java.management
  43  *          jdk.jartool/sun.tools.jar
  44  * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
  45  * @run main BasicTests
  46  *
  47  * This test will perform a number of basic attach tests.
  48  */
  49 public class BasicTests {
  50 
  51     /*
  52      * The actual test is in the nested class TestMain.
  53      * The responsibility of this class is to:
  54      * 1. Build all needed jars.
  55      * 2. Start the Application class in a separate process.
  56      * 3. Find the pid and shutdown port of the running Application.
  57      * 4. Launches the tests in nested class TestMain that will attach to the Application.
  58      * 5. Shut down the Application.
  59      */
  60     public static void main(String args[]) throws Throwable {
  61         ProcessThread processThread = null;
  62         try {
  63             buildJars();


< prev index next >