OSDN Git Service

PR java/16789:
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / Process_6.java
1 // Create a running process for a non existent executable.
2 // Verify that IOException is thrown.
3 import java.io.IOException;
4
5
6 public class Process_6
7 {
8   public static void main(String[] args)
9   {
10     try
11       {
12         int c;
13         Runtime r = Runtime.getRuntime();
14         String[] a = { "blablabla_failure" };
15
16         try
17           {
18             Process p = r.exec(a);
19             System.out.println("bad");
20           }
21         catch (IOException ioe)
22           {
23             System.out.println("ok");
24           }
25       }
26     catch (Exception ex)
27       {
28         System.out.println(ex.toString());
29       }
30   }
31 }