Java 类io.vertx.core.net.impl.SocketAddressImpl 实例源码

项目:incubator-servicecomb-java-chassis    文件:TestHighwayServerConnection.java   
@Before
public void init() {
  new Expectations(CseContext.getInstance()) {
    {
      netSocket.remoteAddress();
      result = new SocketAddressImpl(new InetSocketAddress("127.0.0.1", 80));
    }
  };
  connection = new HighwayServerConnection();
  connection.init(netSocket);

  header = new RequestHeader();
}
项目:vertx-prometheus-metrics    文件:ExternalServerTest.java   
@Test
public void test() {
  MetricsServer
      .create(vertx())
      .apply(CollectorRegistry.defaultRegistry, ExpositionFormat.Text)
      .apply(new SocketAddressImpl(new InetSocketAddress(PORT)));

  await(response(body -> context().assertTrue(body.length() > 0, "Response is empty")));
}
项目:vaadin-vertx-samples    文件:VertxVaadinRequestUT.java   
@Test
public void shouldDelegateGetRemoteAddress() {
    when(httpServerRequest.remoteAddress())
        .thenReturn(null)
        .thenReturn(new SocketAddressImpl(8080, "10.3.100.108"));
    assertThat(vaadinRequest.getRemoteAddr()).isNull();
    assertThat(vaadinRequest.getRemoteAddr()).isEqualTo("10.3.100.108");
}
项目:vertx-hawkular-metrics    文件:HttpClientMetricsImpl.java   
@Override
public SocketAddress connected(SocketAddress remoteAddress, String remoteName) {
  SocketAddress key = new SocketAddressImpl(remoteAddress.port(), remoteName);
  HttpClientConnectionsMeasurements measurements = connectionsMeasurements.get(key);
  if (measurements == null) {
    measurements = connectionsMeasurements.computeIfAbsent(key, address -> new HttpClientConnectionsMeasurements());
  }
  measurements.incrementConnections();
  return key;
}
项目:vertx-rx    文件:EqualityTest.java   
@Test
public void testSocketAddressEquality() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertNotSame(address1, address2);
  assertEquals(address1, address2);
}
项目:vertx-rx    文件:EqualityTest.java   
@Test
public void testSocketAddressEquality() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertNotSame(address1, address2);
  assertEquals(address1, address2);
}
项目:vertx-prometheus-metrics    文件:DatagramSocketPrometheusMetrics.java   
@Override
public void listening(@NotNull String localName, @NotNull SocketAddress localAddress) {
  this.namedLocalAddress = new SocketAddressImpl(localAddress.port(), localName);
}
项目:vaadin-vertx-samples    文件:VertxVaadinRequestUT.java   
@Test
public void shouldDelegateGetRemoteHost() {
    when(httpServerRequest.remoteAddress()).thenReturn(null, new SocketAddressImpl(5555, "10.1.1.1"));
    assertThat(vaadinRequest.getRemoteAddr()).isNull();
    assertThat(vaadinRequest.getRemoteAddr()).isEqualTo("10.1.1.1");
}
项目:vaadin-vertx-samples    文件:VertxVaadinRequestUT.java   
@Test
public void shouldDelegateGetRemotePort() {
    when(httpServerRequest.remoteAddress()).thenReturn(null, new SocketAddressImpl(5555, "10.1.1.1"));
    assertThat(vaadinRequest.getRemotePort()).isEqualTo(-1);
    assertThat(vaadinRequest.getRemotePort()).isEqualTo(5555);
}
项目:vertx-hawkular-metrics    文件:DatagramSocketMetricsImpl.java   
@Override
public void listening(String localName, SocketAddress localAddress) {
  this.localAddress = new SocketAddressImpl(localAddress.port(), localName);
}
项目:vertx-hawkular-metrics    文件:NetClientMetricsImpl.java   
@Override
public SocketAddress connected(SocketAddress remoteAddress, String remoteName) {
  SocketAddress key = new SocketAddressImpl(remoteAddress.port(), remoteName);
  connectionsMeasurements.computeIfAbsent(key, address -> new NetClientConnectionsMeasurements()).incrementConnections();
  return key;
}
项目:vertx-rx    文件:ToStringTest.java   
@Test
public void testSocketAddressToString() {
  io.vertx.core.net.SocketAddress socketAddress = new SocketAddressImpl(8888, "guest");
  SocketAddress rxSocketAddress = SocketAddress.newInstance(socketAddress);
  assertEquals(socketAddress.toString(), rxSocketAddress.toString());
}
项目:vertx-rx    文件:EqualityTest.java   
@Test
public void testSocketAddressSet() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertEquals(1, Stream.of(address1, address2).collect(toSet()).size());
}
项目:vertx-rx    文件:ToStringTest.java   
@Test
public void testSocketAddressToString() {
  io.vertx.core.net.SocketAddress socketAddress = new SocketAddressImpl(8888, "guest");
  SocketAddress rxSocketAddress = SocketAddress.newInstance(socketAddress);
  assertEquals(socketAddress.toString(), rxSocketAddress.toString());
}
项目:vertx-rx    文件:EqualityTest.java   
@Test
public void testSocketAddressSet() {
  SocketAddress address1 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  SocketAddress address2 = SocketAddress.newInstance(new SocketAddressImpl(8888, "guest"));
  assertEquals(1, Stream.of(address1, address2).collect(toSet()).size());
}
项目:vertx-prometheus-metrics    文件:VertxPrometheusOptions.java   
/**
 * Prometheus Metrics server address.
 *
 * @return server address
 */
public @NotNull SocketAddress getAddress() {
  return new SocketAddressImpl(port, host);
}