1
2
3
4
5
6
7
8
9
10
11 package org.mule.management.agents;
12
13 import org.mule.tck.AbstractMuleTestCase;
14
15 public class RmiRegistryAgentTestCase extends AbstractMuleTestCase
16 {
17
18 public void testHostSetOnly() throws Exception
19 {
20 RmiRegistryAgent agent = new RmiRegistryAgent();
21 agent.setHost("www.example.com");
22 agent.initialise();
23 assertEquals("rmi://www.example.com:1099", agent.getServerUri());
24 }
25
26 public void testPortSetOnly() throws Exception
27 {
28 RmiRegistryAgent agent = new RmiRegistryAgent();
29 agent.setPort("1095");
30 agent.initialise();
31 assertEquals("rmi://localhost:1095", agent.getServerUri());
32 }
33
34 public void testHostAndPortSet() throws Exception
35 {
36 RmiRegistryAgent agent = new RmiRegistryAgent();
37 agent.setPort("1095");
38 agent.setHost("www.example.com");
39 agent.initialise();
40 assertEquals("rmi://www.example.com:1095", agent.getServerUri());
41 }
42
43
44
45 }