1   /*
2    * $Id: CompensateImplTest.java,v 1.1 2004/12/15 14:18:15 patforna Exp $
3    *
4    * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
5    * Berne University of Applied Sciences
6    * School of Engineering and Information Technology
7    * All rights reserved.
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       * @see TestCase#setUp()
26       */
27      protected void setUp() throws Exception {
28          super.setUp();
29          compensate = new CompensateImpl();
30      }
31  
32      /*
33       * @see TestCase#tearDown()
34       */
35      protected void tearDown() throws Exception {
36          super.tearDown();
37          compensate = null;
38      }
39  
40      //***************************************************/
41      // test
42      //***************************************************/
43  
44      //***************************************************/
45      // bexee.model.activity.BPELElement
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  }