From: Vincent M. <vm...@pi...> - 2003-05-18 06:59:11
|
Hi, It is currently very difficult to write common setUp using the new Dyna Mock API (it was easy with the previous DynaMock API). The main reason is that you cannot write something like that: public void setUp() { mock.matchAndReturn("create", C.ANY_ARGS, whatever); } public void test1() { [...] } public void test2() { [...] } public void testException() { mock.expectAndThrow("create", C.ANY_ARGS, new CreateException("error")); [...] } The testException() test will fail with: junit.framework.AssertionFailedError: mockOrderLocalHome: create(<ANY>) was expected but not called I think that it would be a normal behavior that expectations override matches. What do you think? Thanks -Vincent |