assertEquals("multihome", locator.getHost());
String connectHomes = locator.getConnectHomes();
assertEquals("a.b:55!c.d:44!e.f:66", connectHomes);
List connectHomeList = locator.getConnectHomeList();
assertEquals(3, connectHomeList.size());
assertEquals(new Home("a.b", 55), connectHomeList.get(0));
assertEquals(new Home("c.d", 44), connectHomeList.get(1));
assertEquals(new Home("e.f", 66), connectHomeList.get(2));
String homes = locator.getHomes();
assertEquals("g.h:77!i.j:44", homes);
List homeList = locator.getHomeList();
assertEquals(2, homeList.size());
assertEquals(new Home("g.h", 77), homeList.get(0));
assertEquals(new Home("i.j", 44), homeList.get(1));
url = "socket://multihome:44/?homes=a.b:55!c.d!e.f:66";
locator = new InvokerLocator(url);
assertEquals("multihome", locator.getHost());
homes = locator.getHomes();
assertEquals("a.b:55!c.d:44!e.f:66", homes);
homeList = locator.getHomeList();
assertEquals(3, homeList.size());
assertEquals(new Home("a.b", 55), homeList.get(0));
assertEquals(new Home("c.d", 44), homeList.get(1));
assertEquals(new Home("e.f", 66), homeList.get(2));
connectHomes = locator.getConnectHomes();
assertEquals("", connectHomes);
connectHomeList = locator.getConnectHomeList();
assertEquals(0, connectHomeList.size());
// Test with host != "multihome".
url = "socket://jboss.org:44/?connecthomes=a.b:55!c.d!e.f:66&homes=g.h:77!i.j";
locator = new InvokerLocator(url);
assertEquals("jboss.org", locator.getHost());
assertEquals(44, locator.getPort());
assertEquals("g.h:77!i.j:44", locator.getHomes());
assertEquals(2, locator.getHomeList().size());
assertTrue(locator.getHomeList().contains(new Home("g.h", 77)));
assertTrue(locator.getHomeList().contains(new Home("i.j", 44)));
assertEquals("jboss.org:44", locator.getConnectHomes());
assertEquals(1, locator.getConnectHomeList().size());
assertTrue(locator.getConnectHomeList().contains(new Home("jboss.org", 44)));
url = "socket://jboss.org:44/?homes=a.b:55!c.d!e.f:66";
locator = new InvokerLocator(url);
assertEquals("jboss.org", locator.getHost());
assertEquals(44, locator.getPort());
assertEquals("a.b:55!c.d:44!e.f:66", locator.getHomes());
homeList = locator.getHomeList();
assertEquals(3, homeList.size());
assertTrue(homeList.contains(new Home("a.b", 55)));
assertTrue(homeList.contains(new Home("c.d", 44)));
assertTrue(homeList.contains(new Home("e.f", 66)));
connectHomes = locator.getConnectHomes();
assertEquals("jboss.org:44", connectHomes);
connectHomeList = locator.getConnectHomeList();
assertEquals(1, connectHomeList.size());
assertEquals(new Home("jboss.org", 44), connectHomeList.get(0));
// Test InvokerLocator.isMultihome().
locator = new InvokerLocator("socket://jboss.org:44");
assertFalse(locator.isMultihome());
locator = new InvokerLocator("socket://jboss.org:44/?homes=a.b:55!c.d!e.f:66");