< prev index next >

test/jdk/java/lang/ClassLoader/GetSystemPackage.java

Print this page
@@ -22,10 +22,11 @@
   */
  
  /*
   * @test
   * @bug 8060130
+  * @requires vm.flagless
   * @library /test/lib
   * @build package2.Class2 GetSystemPackage
   * @summary Test if getSystemPackage() return consistent values for cases
   *          where a manifest is provided or not and ensure only jars on
   *          bootclasspath gets resolved via Package.getSystemPackage

@@ -39,10 +40,12 @@
  import java.io.IOException;
  import java.util.jar.Attributes;
  import java.util.jar.JarEntry;
  import java.util.jar.JarOutputStream;
  import java.util.jar.Manifest;
+ 
+ import jdk.test.lib.process.OutputAnalyzer;
  import jdk.test.lib.process.ProcessTools;
  
  public class GetSystemPackage {
  
      static final String testClassesDir = System.getProperty("test.classes", ".");

@@ -116,12 +119,13 @@
      }
  
      private static void runSubProcess(String messageOnError, String ... args)
              throws Exception
      {
-         ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args);
-         int res = pb.directory(tmpFolder).inheritIO().start().waitFor();
+         ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(args)
+                                         .directory(tmpFolder);
+         int res = ProcessTools.executeProcess(pb).getExitValue();
          if (res != 0) {
              throw new RuntimeException(messageOnError);
          }
      }
  
< prev index next >