public void exceptionHandler(Exception e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "exceptionHandler", entity));
}
public void agenda() {
fifo.add(new WaitResultTest(entity.getTimeNow(), "Agenda begun", entity));
try {
entity.schedule("eventThatDoesNotExist", 2.0);
}
catch (IllegalArgumentException e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "not there", entity));
}
try {
entity.schedule("eventIsHere", 2.0);
}
catch (IllegalArgumentException e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "wrong signature 1", entity));
}
try {
entity.schedule("eventIsHere", 2.0, 6.0);
}
catch (IllegalArgumentException e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "wrong signature 2", entity));
}
try {
entity.schedule("eventSimple", -1.0);
}
catch (IllegalArgumentException e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "negative delay", entity));
}
entity.schedule("eventIsHere", 2.0, "A String");
fifo.add(new WaitResultTest(entity.getTimeNow(), "right signature", entity));
entity.schedule("eventSimple", 2.0);
fifo.add(new WaitResultTest(entity.getTimeNow(), "simple signature", entity));
try {
entity.schedule("agenda", 2.0);
}
catch (IllegalArgumentException e) {
fifo.add(new WaitResultTest(entity.getTimeNow(), "agenda", entity));
}
entity.schedule("eventBad", 1.0);
fifo.add(new WaitResultTest(entity.getTimeNow(), "Agenda end", entity));
}