}
}
public void testFailure()
{
SimpleSetWithAdaptor sut = new SimpleSetWithAdaptor(new StringSetBuggy());
Model model = new Model(sut);
model.addListener(new StopOnFailureListener());
int addS1 = model.getActionNumber("addS1");
try {
assertTrue(model.doAction(addS1));
fail("Action delS2 (with sut=StringSetBuggy) should have failed");
}
catch (TestFailureException ex) {
assertEquals("failure in action addS1 from state FF due to ",
ex.getMessage().subSequence(0, 45));
assertEquals("FF", ex.getState());
assertEquals("addS1", ex.getActionName());
assertEquals(sut, ex.getModel());
assertEquals(sut.getClass().getName(), ex.getModelName());
List<Transition> trs = ex.getSequence();
assertEquals(0, trs.size());
}
}