added unit tst for getProcessStatus(), fixed scoping issue in processmanager
This commit is contained in:
parent
9754f23fd8
commit
d9beaff898
2 changed files with 20 additions and 5 deletions
|
|
@ -38,12 +38,27 @@ public class ProcessManagerTest {
|
|||
*/
|
||||
@Test
|
||||
public void addProcessesTest() {
|
||||
int pid1 = manager.newProcess("ping google");
|
||||
assertEquals(0, pid1);
|
||||
int pid1 = manager.newProcess("ping google.com");
|
||||
int pid2 = manager.newProcess("ping google.com");
|
||||
assertEquals(2, pid2);
|
||||
assertEquals(1, pid1);
|
||||
|
||||
int pid2 = manager.newProcess("ping google");
|
||||
assertEquals(1, pid2);
|
||||
manager.shutdown();
|
||||
}
|
||||
|
||||
/*
|
||||
* getStatusTest
|
||||
* positive unit test for getStatus
|
||||
*/
|
||||
@Test
|
||||
public void getStatusTest() {
|
||||
int pid1 = manager.newProcess("ping google.com");
|
||||
assertEquals(0, pid1);
|
||||
|
||||
int status = manager.getProcessStatus(pid1);
|
||||
assertEquals(0, status);
|
||||
|
||||
manager.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue