finished unit tests, better process status reporting
This commit is contained in:
parent
7d8f8111c8
commit
eb15da6ae2
3 changed files with 48 additions and 16 deletions
|
|
@ -86,7 +86,7 @@ public class ProcessManagerTest {
|
|||
@Test
|
||||
public void getUnknownStatusTest() {
|
||||
int status = manager.getProcessStatus(400);
|
||||
assertEquals(2, status);
|
||||
assertEquals(3, status);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -160,17 +160,20 @@ public class ProcessManagerTest {
|
|||
/*
|
||||
* killProcessTest()
|
||||
* ensures killing a process works
|
||||
* also tests if getProcessStatus returns 2
|
||||
*/
|
||||
@Test
|
||||
public void killProcessTest() {
|
||||
int pid = manager.newProcess("sleep 10");
|
||||
int ret = manager.killProcess(pid);
|
||||
|
||||
assertEquals(0, ret);
|
||||
assertEquals(1, ret);
|
||||
|
||||
int status = manager.getProcessStatus(pid);
|
||||
|
||||
assertEquals(1, status);
|
||||
assertEquals(2, status);
|
||||
|
||||
manager.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue