< prev index next >

test/jdk/java/net/URLClassLoader/getresourceasstream/TestDriver.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -34,11 +34,10 @@
   *        jdk.test.lib.process.*
   *        Test
   * @run main/othervm TestDriver
   */
  
- import jdk.test.lib.JDKToolFinder;
  import jdk.test.lib.process.ProcessTools;
  
  import java.io.IOException;
  import java.nio.file.Files;
  import java.nio.file.Path;

@@ -51,37 +50,37 @@
      private static final String POLICY_FILE = "policy";
      public static void main(String[] args)
              throws Throwable {
  
          Path userDir = Paths.get(System.getProperty("user.dir"));
-         String java = JDKToolFinder.getTestJDKTool("java");
          String basename = userDir.getFileName().toString();
          setup(userDir);
          ProcessBuilder[] tests = new ProcessBuilder[]{
-                 new ProcessBuilder(
-                         java, TEST_NAME, "./" + ARCHIVE_NAME
+                 ProcessTools.createTestJavaProcessBuilder(
+                         TEST_NAME,
+                         "./" + ARCHIVE_NAME
                  ),
-                 new ProcessBuilder(
-                         java, "-cp", ".",
+                 ProcessTools.createTestJavaProcessBuilder(
+                         "-cp", ".",
                          "-Djava.security.policy=file:./policy",
                          "-Djava.security.manager",
                          TEST_NAME, "./" + ARCHIVE_NAME
                  ),
-                 new ProcessBuilder(
-                         java, "-cp", ".",
+                 ProcessTools.createTestJavaProcessBuilder(
+                         "-cp", ".",
                          "-Djava.security.policy=file:./policy",
                          "-Djava.security.manager",
                          TEST_NAME, "./" + ARCHIVE_NAME
                  ),
-                 new ProcessBuilder(
-                         java, "-cp", "..",
+                 ProcessTools.createTestJavaProcessBuilder(
+                         "-cp", "..",
                          "-Djava.security.policy=file:../policy",
                          "-Djava.security.manager",
                          TEST_NAME, "../" + ARCHIVE_NAME
                  ).directory(userDir.resolve("tmp").toFile()),
-                 new ProcessBuilder(
-                         java, "-cp", basename,
+                 ProcessTools.createTestJavaProcessBuilder(
+                         "-cp", basename,
                          "-Djava.security.policy=file:" + basename + "/policy",
                          "-Djava.security.manager",
                          TEST_NAME, basename + "/" + ARCHIVE_NAME
                  ).directory(userDir.resolve("..").toFile())};
          for (ProcessBuilder test : tests) {
< prev index next >