< prev index next >

test/jdk/java/lang/management/MemoryMXBean/RunUtil.java

Print this page
rev 51731 : imported patch 8210732


  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 /**
  25  * Utility class for launching a test in a separate JVM.
  26  */
  27 
  28 import java.util.List;
  29 import java.util.ArrayList;
  30 import java.util.Arrays;
  31 import jdk.test.lib.JDKToolFinder;
  32 import jdk.test.lib.process.OutputAnalyzer;
  33 import jdk.test.lib.process.ProcessTools;
  34 import jdk.testlibrary.Utils;
  35 
  36 public class RunUtil {
  37 
  38     // Used to mark that the test has passed successfully.
  39     public static final String successMessage = "Test passed.";
  40 
  41     public static void runTestClearGcOpts(String main, String... testOpts) throws Throwable {
  42         runTest(main, true, testOpts);
  43     }
  44 
  45     public static void runTestKeepGcOpts(String main, String... testOpts) throws Throwable {
  46         runTest(main, false, testOpts);
  47     }
  48 
  49     /**
  50      * Runs a test in a separate JVM.
  51      * command line like:
  52      * {test_jdk}/bin/java {defaultopts} -cp {test.class.path} {testopts} main
  53      *
  54      * {defaultopts} are the default java options set by the framework.




  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 /**
  25  * Utility class for launching a test in a separate JVM.
  26  */
  27 
  28 import java.util.List;
  29 import java.util.ArrayList;
  30 import java.util.Arrays;
  31 import jdk.test.lib.JDKToolFinder;
  32 import jdk.test.lib.process.OutputAnalyzer;
  33 import jdk.test.lib.process.ProcessTools;
  34 import jdk.test.lib.Utils;
  35 
  36 public class RunUtil {
  37 
  38     // Used to mark that the test has passed successfully.
  39     public static final String successMessage = "Test passed.";
  40 
  41     public static void runTestClearGcOpts(String main, String... testOpts) throws Throwable {
  42         runTest(main, true, testOpts);
  43     }
  44 
  45     public static void runTestKeepGcOpts(String main, String... testOpts) throws Throwable {
  46         runTest(main, false, testOpts);
  47     }
  48 
  49     /**
  50      * Runs a test in a separate JVM.
  51      * command line like:
  52      * {test_jdk}/bin/java {defaultopts} -cp {test.class.path} {testopts} main
  53      *
  54      * {defaultopts} are the default java options set by the framework.


< prev index next >