View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.ejb;
8   
9   import org.mule.api.transport.Connector;
10  import org.mule.transport.AbstractConnectorTestCase;
11  
12  import org.junit.Test;
13  
14  import static org.junit.Assert.assertEquals;
15  import static org.junit.Assert.assertNotNull;
16  
17  public class EjbConnectorTestCase extends AbstractConnectorTestCase
18  {
19  
20      public Connector createConnector() throws Exception
21      {
22          EjbConnector c = new EjbConnector(muleContext);
23          c.setName("EjbConnector");
24          c.setSecurityManager(null);
25          return c;
26      }
27  
28      public String getTestEndpointURI()
29      {
30          return "ejb://localhost:1099";
31      }
32  
33      public Object getValidMessage() throws Exception
34      {
35          return "Hello".getBytes();
36      }
37  
38      @Test
39      public void testProperties() throws Exception
40      {
41          EjbConnector c = (EjbConnector) getConnector();
42  
43          String securityPolicy = "rmi.policy";
44          String serverCodebase = "file:///E:/projects/MyTesting/JAVA/rmi/classes/";
45  
46          c.setSecurityPolicy(securityPolicy);
47          assertNotNull(c.getSecurityPolicy());
48          c.setServerCodebase(serverCodebase);
49          assertEquals(serverCodebase, c.getServerCodebase());
50      }
51  
52  }