jdk/test/java/lang/ProcessBuilder/Basic.java
changeset 20191 f0e23e7272d6
parent 19399 e2e5122cd62e
child 21813 f7e97f5bb5a2
child 22597 7515a991bb37
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Fri Sep 20 17:11:32 2013 -0700
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Mon Sep 23 04:05:42 2013 +0100
@@ -298,11 +298,15 @@
                     System.exit(5);
                 System.err.print("standard error");
                 System.out.print("standard output");
-            } else if (action.equals("testInheritIO")) {
+            } else if (action.equals("testInheritIO")
+                    || action.equals("testRedirectInherit")) {
                 List<String> childArgs = new ArrayList<String>(javaChildArgs);
                 childArgs.add("testIO");
                 ProcessBuilder pb = new ProcessBuilder(childArgs);
-                pb.inheritIO();
+                if (action.equals("testInheritIO"))
+                    pb.inheritIO();
+                else
+                    redirectIO(pb, INHERIT, INHERIT, INHERIT);
                 ProcessResults r = run(pb);
                 if (! r.out().equals(""))
                     System.exit(7);
@@ -1019,10 +1023,10 @@
         // Note that this requires __FOUR__ nested JVMs involved in one test,
         // if you count the harness JVM.
         //----------------------------------------------------------------
-        {
+        for (String testName : new String[] { "testInheritIO", "testRedirectInherit" } ) {
             redirectIO(pb, PIPE, PIPE, PIPE);
             List<String> command = pb.command();
-            command.set(command.size() - 1, "testInheritIO");
+            command.set(command.size() - 1, testName);
             Process p = pb.start();
             new PrintStream(p.getOutputStream()).print("standard input");
             p.getOutputStream().close();