01: package net.sf.mockcreator;
02:
03: import net.sf.mockcreator.Struct;
04: import net.sf.mockcreator.exceptions.MockException;
05: import net.sf.mockcreator.expectable.MockExpectables;
06:
07: public class BugEmptyExceptionMessageTest extends TestCase {
08: MockExpectables mock;
09:
10: public BugEmptyExceptionMessageTest(String name) {
11: super (name);
12: }
13:
14: public void setUp() throws Exception {
15: super .setUp();
16: mock = new MockExpectables();
17: }
18:
19: public void testUnexpected() {
20: mock.expectMap(new Struct(1, 2, 3, "bar")).returns(
21: new Struct(2, 2, 2, "2"));
22: mock.expectMap(new Struct(5, 6, 7, "hello")).returns(
23: new Struct(1, 1, 1, "1"));
24:
25: try {
26: mock.map(new Struct(5, 6, 7, "hello"));
27: fail();
28: } catch (MockException ex) {
29: assertTrue(ex.getExpectations() != null
30: && ex.getExpectations().size() == 2);
31: }
32: }
33: }
|