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 /**
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.testlibrary.OutputAnalyzer;
32 import jdk.testlibrary.Utils;
33 import jdk.testlibrary.ProcessTools;
34 import jdk.testlibrary.JDKToolFinder;
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 *
|
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 /**
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.process.OutputAnalyzer;
32 import jdk.test.lib.process.ProcessTools;
33 import jdk.testlibrary.Utils;
34 import jdk.testlibrary.JDKToolFinder;
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 *
|