unit tests for ProcessManager
This commit is contained in:
parent
d9beaff898
commit
7d8f8111c8
2 changed files with 126 additions and 14 deletions
|
|
@ -189,16 +189,16 @@ class ProcessManager {
|
|||
|
||||
/*
|
||||
* killProcess()
|
||||
* returns false if couldnt grab lock
|
||||
* ALSO RETURNS TRUE IF PROCESS DOESNT EXIST
|
||||
* returns 1 if couldnt grab lock
|
||||
* ALSO RETURNS 0 IF PROCESS DOESNT EXIST
|
||||
*/
|
||||
public Boolean killProcess(int pid) {
|
||||
public int killProcess(int pid) {
|
||||
try {
|
||||
this.getLock();
|
||||
|
||||
} catch (TimeoutException e) {
|
||||
System.err.println("Timeout killing process: " + e.getMessage());
|
||||
return false;
|
||||
return 1;
|
||||
}
|
||||
|
||||
ProcessController candidate = this.processMap.get(pid);
|
||||
|
|
@ -207,7 +207,7 @@ class ProcessManager {
|
|||
}
|
||||
|
||||
this.releaseLock();
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue