mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
9bb3d6b972
git-subtree-dir: sgx-jvm/avian git-subtree-mainline:f978eab8d1
git-subtree-split:09e4fe60d0
32 lines
784 B
Java
32 lines
784 B
Java
import java.io.IOException;
|
|
|
|
public class Processes {
|
|
public static void main(String[] args) {
|
|
long start = System.currentTimeMillis();
|
|
try {
|
|
final Process p = Runtime.getRuntime().exec("sleep 10");
|
|
new Thread() {
|
|
public void run() {
|
|
try {
|
|
Thread.sleep(100);
|
|
} catch(InterruptedException e) {
|
|
// ignore
|
|
}
|
|
p.destroy();
|
|
}
|
|
}.start();
|
|
try {
|
|
p.waitFor();
|
|
} catch(InterruptedException e) {
|
|
// ignore
|
|
}
|
|
long stop = System.currentTimeMillis();
|
|
if(stop - start > 5000) {
|
|
throw new RuntimeException("test failed; we didn't kill the process...");
|
|
}
|
|
} catch(IOException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|