Search in sources :

Example 1 with TestHost

use of com.datastax.driver.core.TestHost in project presto by prestodb.

the class TestHostAddressFactory method testToHostAddressList.

@Test
public void testToHostAddressList() throws Exception {
    Set<Host> hosts = ImmutableSet.of(new TestHost(new InetSocketAddress(InetAddress.getByAddress(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }), 3000)), new TestHost(new InetSocketAddress(InetAddress.getByAddress(new byte[] { 1, 2, 3, 4 }), 3000)));
    HostAddressFactory hostAddressFactory = new HostAddressFactory();
    List<HostAddress> list = hostAddressFactory.toHostAddressList(hosts);
    assertEquals(list.toString(), "[[102:304:506:708:90a:b0c:d0e:f10], 1.2.3.4]");
}
Also used : TestHost(com.datastax.driver.core.TestHost) InetSocketAddress(java.net.InetSocketAddress) TestHost(com.datastax.driver.core.TestHost) Host(com.datastax.driver.core.Host) HostAddress(com.facebook.presto.spi.HostAddress) Test(org.testng.annotations.Test)

Aggregations

Host (com.datastax.driver.core.Host)1 TestHost (com.datastax.driver.core.TestHost)1 HostAddress (com.facebook.presto.spi.HostAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.testng.annotations.Test)1