use of org.jboss.as.network.NetworkInterfaceBinding in project wildfly by wildfly.
the class UndertowConnectorTestCase method getAddress.
@Test
public void getAddress() throws UnknownHostException {
InetAddress expected = InetAddress.getLocalHost();
NetworkInterfaceBinding interfaceBinding = new NetworkInterfaceBinding(Collections.<NetworkInterface>emptySet(), expected);
SocketBindingManager bindingManager = mock(SocketBindingManager.class);
SocketBinding binding = new SocketBinding("socket", 1, true, null, 0, interfaceBinding, bindingManager, Collections.<ClientMapping>emptyList());
when(this.listener.getSocketBinding()).thenReturn(binding);
InetAddress result = this.connector.getAddress();
assertSame(expected, result);
}
use of org.jboss.as.network.NetworkInterfaceBinding in project wildfly by wildfly.
the class UndertowConnectorTestCase method getPort.
@Test
public void getPort() throws UnknownHostException {
int expected = 10;
NetworkInterfaceBinding interfaceBinding = new NetworkInterfaceBinding(Collections.<NetworkInterface>emptySet(), InetAddress.getLocalHost());
SocketBindingManager bindingManager = mock(SocketBindingManager.class);
SocketBinding binding = new SocketBinding("socket", expected, true, null, 0, interfaceBinding, bindingManager, Collections.<ClientMapping>emptyList());
when(this.listener.getSocketBinding()).thenReturn(binding);
int result = this.connector.getPort();
assertSame(expected, result);
}
Aggregations