1   /*
2    * $Id: BpmConnectorTestCase.java 11343 2008-03-13 10:58:26Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.bpm;
12  
13  import org.mule.api.transport.Connector;
14  import org.mule.transport.AbstractConnectorTestCase;
15  import org.mule.transport.bpm.test.TestBpms;
16  
17  import com.mockobjects.dynamic.Mock;
18  
19  /**
20   * Generic connector tests.
21   */
22  public class BpmConnectorTestCase extends AbstractConnectorTestCase
23  {
24  
25      /*
26       * (non-Javadoc)
27       * 
28       * @see org.mule.tck.providers.AbstractConnectorTestCase#getConnector()
29       */
30      public Connector createConnector() throws Exception
31      {
32          ProcessConnector c = new ProcessConnector();
33          c.setName("ProcessConnector");
34          c.setBpms(new TestBpms());
35  
36          return c;
37      }
38  
39      public void testMessageServiceSet() throws Exception
40      {
41          ProcessConnector c = (ProcessConnector) this.createConnector();
42          // The BPMS must be set prior to initializing the connector.
43          Mock bpms = new Mock(BPMS.class);
44          bpms.expect("setMessageService", c);
45          c.setBpms((BPMS) bpms.proxy());
46          c.setMuleContext(muleContext);
47          c.initialise();
48          bpms.verify();
49      }
50  
51      /*
52       * (non-Javadoc)
53       * 
54       * @see org.mule.tck.providers.AbstractConnectorTestCase#getValidMessage()
55       */
56      public Object getValidMessage() throws Exception
57      {
58          return "test";
59      }
60  
61      /*
62       * (non-Javadoc)
63       * 
64       * @see org.mule.tck.providers.AbstractConnectorTestCase#getTestEndpointURI()
65       */
66      public String getTestEndpointURI()
67      {
68          return "bpm://dummyProcess?processId=1234";
69      }
70  
71  }