< prev index next >

test/jdk/java/lang/ProcessBuilder/InheritIOTest.java

Print this page

 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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  * @test
26  * @bug 8023130 8166026
27  * @summary Unit test for java.lang.ProcessBuilder inheritance of standard output and standard error streams

28  * @library /test/lib
29  * @build jdk.test.lib.process.*
30  * @run testng InheritIOTest
31  */
32 
33 import java.util.List;
34 import static java.lang.ProcessBuilder.Redirect.INHERIT;
35 import jdk.test.lib.process.OutputAnalyzer;
36 import jdk.test.lib.process.ProcessTools;
37 import org.testng.annotations.DataProvider;
38 import org.testng.annotations.Test;
39 import static org.testng.Assert.*;
40 
41 public class InheritIOTest {
42 
43     private static final String EXIT_VALUE_TEMPLATE = "exit value: %d";
44     private static final String EXPECTED_RESULT_STDOUT = "message";
45     private static final String EXPECTED_RESULT_STDERR = EXIT_VALUE_TEMPLATE.formatted(0);
46 
47     @DataProvider

 8  *
 9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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  * @test
26  * @bug 8023130 8166026
27  * @summary Unit test for java.lang.ProcessBuilder inheritance of standard output and standard error streams
28  * @requires vm.flagless
29  * @library /test/lib
30  * @build jdk.test.lib.process.*
31  * @run testng InheritIOTest
32  */
33 
34 import java.util.List;
35 import static java.lang.ProcessBuilder.Redirect.INHERIT;
36 import jdk.test.lib.process.OutputAnalyzer;
37 import jdk.test.lib.process.ProcessTools;
38 import org.testng.annotations.DataProvider;
39 import org.testng.annotations.Test;
40 import static org.testng.Assert.*;
41 
42 public class InheritIOTest {
43 
44     private static final String EXIT_VALUE_TEMPLATE = "exit value: %d";
45     private static final String EXPECTED_RESULT_STDOUT = "message";
46     private static final String EXPECTED_RESULT_STDERR = EXIT_VALUE_TEMPLATE.formatted(0);
47 
48     @DataProvider
< prev index next >