MCPcopy Create free account
hub / github.com/ReadyTalk/avian / main

Method main

test/Processes.java:4–30  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

2
3public class Processes {
4 public static void main(String[] args) {
5 long start = System.currentTimeMillis();
6 try {
7 final Process p = Runtime.getRuntime().exec("sleep 10");
8 new Thread() {
9 public void run() {
10 try {
11 Thread.sleep(100);
12 } catch(InterruptedException e) {
13 // ignore
14 }
15 p.destroy();
16 }
17 }.start();
18 try {
19 p.waitFor();
20 } catch(InterruptedException e) {
21 // ignore
22 }
23 long stop = System.currentTimeMillis();
24 if(stop - start > 5000) {
25 throw new RuntimeException("test failed; we didn't kill the process...");
26 }
27 } catch(IOException e) {
28 throw new RuntimeException(e);
29 }
30 }
31}

Callers

nothing calls this directly

Calls 5

currentTimeMillisMethod · 0.95
getRuntimeMethod · 0.95
waitForMethod · 0.95
execMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected