/* * ProcessManagerTest * * v1.0 * * May 22, 2019 */ package JobServ; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import static org.junit.Assert.assertEquals; /* * ProcessManagerTest * Class that performs positive and negative unit tests * of every public method in ProcessManager. This not * only unit tests ProcessManager but also integration * tests it with ProcessController. */ public class ProcessManagerTest { ProcessManager manager; /* * ProcessManagerTest constructor * initializes the process manager */ public ProcessManagerTest() { manager = new ProcessManager(); } /* * addProcessTest() * positive unit test for newProcess */ @Test public void addProcessesTest() { int pid1 = manager.newProcess("ping google"); assertEquals(0, pid1); int pid2 = manager.newProcess("ping google"); assertEquals(1, pid2); } }