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