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.rmi;
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 RmiConnectorTestCase extends AbstractConnectorTestCase
18  {
19  
20      @Override
21      public Connector createConnector() throws Exception
22      {
23          RmiConnector c = new RmiConnector(muleContext);
24          c.setName("RmiConnector");
25          c.setSecurityManager(null);
26          return c;
27      }
28  
29      public String getTestEndpointURI()
30      {
31          return "rmi://localhost:1099";
32      }
33  
34      public Object getValidMessage() throws Exception
35      {
36          return "Hello".getBytes();
37      }
38  
39      @Test
40      public void testProperties() throws Exception
41      {
42          RmiConnector c = (RmiConnector)getConnector();
43  
44          String securityPolicy = "rmi.policy";
45          String serverCodebase = "file:///E:/projects/MyTesting/JAVA/rmi/classes/";
46  
47          c.setSecurityPolicy(securityPolicy);
48          assertNotNull(c.getSecurityPolicy());
49          c.setServerCodebase(serverCodebase);
50          assertEquals(serverCodebase, c.getServerCodebase());
51      }
52  
53  }