1 // Create a long running process and verify that the exitValue is not
2 // immediately available. Then destroy() it and verify that it
3 // terminates quickly with a non-zero exitValue.
6 public static void main(String
[] args
)
11 long startTime
= System
.currentTimeMillis();
12 Runtime r
= Runtime
.getRuntime();
13 String
[] a
= { "sleep", "120" };
14 Process p
= r
.exec(a
);
19 System
.out
.println("bad 1");
22 catch (IllegalThreadStateException itse
)
24 // Ignore as this is good here.
31 long endTime
= System
.currentTimeMillis();
33 if (endTime
- startTime
> 110000L)
34 System
.out
.println("bad 2");
36 System
.out
.println(c
!= 0 ?
"ok" : "bad 3");
40 System
.out
.println(ex
.toString());