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 java.io.IOException;
25 import java.io.File;
26 import java.nio.file.Files;
27 import java.util.Arrays;
28
29 import jdk.test.lib.thread.ProcessThread;
30 import jdk.test.lib.process.ProcessTools;
31 import jdk.testlibrary.Utils;
32
33 /*
34 * Utility functions for test runners.
35 * (Test runner = class that launch a test)
36 */
37 public class RunnerUtil {
38
39 /**
40 * The Application process must be run concurrently with our tests since
41 * the tests will attach to the Application.
42 * We will run the Application process in a separate thread.
43 *
44 * The Application must be started with flag "-Xshare:off" for the Retransform
45 * test in TestBasics to pass on all platforms.
46 *
47 * The Application will write its pid and shutdownPort in the given outFile.
48 */
49 public static ProcessThread startApplication(String... additionalOpts) throws Throwable {
50 String classpath = System.getProperty("test.class.path", ".");
51 String[] myArgs = concat(additionalOpts, new String [] {
|
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 java.io.IOException;
25 import java.io.File;
26 import java.nio.file.Files;
27 import java.util.Arrays;
28
29 import jdk.test.lib.thread.ProcessThread;
30 import jdk.test.lib.process.ProcessTools;
31 import jdk.test.lib.Utils;
32
33 /*
34 * Utility functions for test runners.
35 * (Test runner = class that launch a test)
36 */
37 public class RunnerUtil {
38
39 /**
40 * The Application process must be run concurrently with our tests since
41 * the tests will attach to the Application.
42 * We will run the Application process in a separate thread.
43 *
44 * The Application must be started with flag "-Xshare:off" for the Retransform
45 * test in TestBasics to pass on all platforms.
46 *
47 * The Application will write its pid and shutdownPort in the given outFile.
48 */
49 public static ProcessThread startApplication(String... additionalOpts) throws Throwable {
50 String classpath = System.getProperty("test.class.path", ".");
51 String[] myArgs = concat(additionalOpts, new String [] {
|