View Javadoc

1   /*
2    * $Id: EjbConnectorTestCase.java 22377 2011-07-11 12:41:42Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.ejb;
12  
13  import org.mule.api.transport.Connector;
14  import org.mule.transport.AbstractConnectorTestCase;
15  
16  import org.junit.Test;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertNotNull;
20  
21  public class EjbConnectorTestCase extends AbstractConnectorTestCase
22  {
23  
24      public Connector createConnector() throws Exception
25      {
26          EjbConnector c = new EjbConnector(muleContext);
27          c.setName("EjbConnector");
28          c.setSecurityManager(null);
29          return c;
30      }
31  
32      public String getTestEndpointURI()
33      {
34          return "ejb://localhost:1099";
35      }
36  
37      public Object getValidMessage() throws Exception
38      {
39          return "Hello".getBytes();
40      }
41  
42      @Test
43      public void testProperties() throws Exception
44      {
45          EjbConnector c = (EjbConnector) getConnector();
46  
47          String securityPolicy = "rmi.policy";
48          String serverCodebase = "file:///E:/projects/MyTesting/JAVA/rmi/classes/";
49  
50          c.setSecurityPolicy(securityPolicy);
51          assertNotNull(c.getSecurityPolicy());
52          c.setServerCodebase(serverCodebase);
53          assertEquals(serverCodebase, c.getServerCodebase());
54      }
55  
56  }