1   /*
2    * $Id: FlowImplTest.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.FlowImpl;
15  
16  /***
17   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:15 $
18   * @author Pawel Kowalski
19   */
20  public class FlowImplTest extends MockObjectTestCase {
21  
22      private FlowImpl flow = null;
23  
24      /*
25       * @see TestCase#setUp()
26       */
27      protected void setUp() throws Exception {
28          super.setUp();
29          flow = new FlowImpl();
30      }
31  
32      /*
33       * @see TestCase#tearDown()
34       */
35      protected void tearDown() throws Exception {
36          super.tearDown();
37          flow = 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(flow), same(processInstance));
55  
56          try {
57              flow.accept((ProcessController) mockProcessController.proxy(),
58                      processInstance);
59          } catch (Exception e) {
60              fail("Should not throw exception: " + e.getMessage());
61          }
62  
63          mockProcessController.verify();
64      }
65  
66      public final void testDefaultValues() {
67          assertEquals(false, flow.isSuppressJoinFailure());
68      }
69  
70  }