1   /*
2    * $Id: RmiRegistryAgentTestCase.java 10120 2007-12-20 18:33:16Z aperepel $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.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  }