/**
* Test method for {@link org.jboss.services.binding.ServiceBinding#getOffsetBinding(int, String)}.
*/
public void testGetOffsetBindingWithHost() throws Exception
{
ServiceBindingMetadata metadata = new ServiceBindingMetadata("svc", "binding", "192.168.0.2", 1, false, true);
ServiceBinding binding = new ServiceBinding(metadata, "192.168.0.3", 10);
assertEquals(metadata.getServiceName(), binding.getServiceName());
assertEquals(metadata.getBindingName(), binding.getBindingName());
assertEquals(metadata.getHostName(), binding.getHostName());
assertEquals(InetAddress.getByName(metadata.getHostName()), binding.getBindAddress());
assertEquals(1, metadata.getPort());
assertEquals(11, binding.getPort());
metadata = new ServiceBindingMetadata("svc", "binding", "192.168.0.2", 1, false, false);
binding = new ServiceBinding(metadata, "192.168.0.3", 10);
assertEquals(metadata.getServiceName(), binding.getServiceName());
assertEquals(metadata.getBindingName(), binding.getBindingName());
assertEquals("192.168.0.3", binding.getHostName());
assertEquals(InetAddress.getByName("192.168.0.3"), binding.getBindAddress());
assertEquals(1, metadata.getPort());
assertEquals(11, binding.getPort());
}