Pe { public void setStatus(int status) { this.status = status; } Pe(int id, PeProvisioner peProvisioner); int getId(); void setMips(double d); int getMips(); int getStatus(); void setStatusFree(); void setStatusBusy(); void setStatusFailed(); void setStatus(int status); PeProvisioner getPeProvisioner(); static final int FREE; static final int BUSY; static final int FAILED; }
@Test public void testSetStatus() { Pe pe = new Pe(0, null); assertEquals(Pe.FREE, pe.getStatus()); pe.setStatusBusy(); assertEquals(Pe.BUSY, pe.getStatus()); pe.setStatusFailed(); assertEquals(Pe.FAILED, pe.getStatus()); pe.setStatusFree(); assertEquals(Pe.FREE, pe.getStatus()); }