import org.junit.Before;
import org.junit.Test;
-import user.jobengine.server.IProgram;
-import user.jobengine.server.Program;
import user.jobengine.server.instructions.CallJobStepInstruction;
import user.jobengine.server.instructions.IInstruction;
import user.jobengine.server.instructions.Instruction;
private IProgram sut = null;
private IInstruction i1 = new CallJobStepInstruction();
private IInstruction i2 = new CallJobStepInstruction();
-
+
@Before
public void setup() throws Exception {
sut = new Program();
sut.addInstruction(i1);
sut.addInstruction(i2);
}
-
+
@Test
public void testGet_OK() throws Exception {
assertEquals(i1, sut.get(0));
assertEquals(i2, sut.get(1));
}
-
+
@Test(expected = IndexOutOfBoundsException.class)
public void testGet_InvalidIndex1() throws Exception {
sut.get(-1);
sut.get(2);
}
- @Test(expected = NullPointerException.class)
+ @Test(expected = NullPointerException.class)
public void testAdd_NullInstruction() throws Exception {
sut.addInstruction(null);
}
assertFalse(program1.equals(program2));
}
- @Test (expected = RuntimeException.class)
+ @Test(expected = RuntimeException.class)
public void testEquals_DifferentInstructions() throws Exception {
// Fixture
IProgram program1 = new Program();