1
2
3
4
5
6
7
8
9 package bexee.model.activity;
10
11 import org.jmock.*;
12
13 import bexee.core.*;
14 import bexee.model.activity.impl.CompensateImpl;
15
16 /***
17 * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:15 $
18 * @author Pawel Kowalski
19 */
20 public class CompensateImplTest extends MockObjectTestCase {
21
22 private CompensateImpl compensate = null;
23
24
25
26
27 protected void setUp() throws Exception {
28 super.setUp();
29 compensate = new CompensateImpl();
30 }
31
32
33
34
35 protected void tearDown() throws Exception {
36 super.tearDown();
37 compensate = null;
38 }
39
40 //***************************************************/
41
42 //***************************************************/
43
44 //***************************************************/
45
46 //***************************************************/
47
48 public final void testAccept() {
49 Mock mockProcessController = new Mock(ProcessController.class);
50
51 ProcessInstance processInstance = new ProcessInstance(null, null);
52
53 mockProcessController.expects(once()).method("process").with(
54 same(compensate), same(processInstance));
55
56 try {
57 compensate.accept(
58 (ProcessController) mockProcessController.proxy(),
59 processInstance);
60 } catch (Exception e) {
61 fail("Should not throw exception: " + e.getMessage());
62 }
63
64 mockProcessController.verify();
65 }
66
67 public final void testDefaultValues() {
68 assertEquals(false, compensate.isSuppressJoinFailure());
69 }
70
71 }