Search in sources :

Example 11 with ServerInfoBuilder

use of com.linkedin.databus.client.pub.ServerInfo.ServerInfoBuilder in project databus by linkedin.

the class TestServerInfo method testBuilderSetAddress.

@Test
public void testBuilderSetAddress() throws Exception {
    ServerInfoBuilder builder = new ServerInfoBuilder();
    String address = ServerInfoBuilder.generateAddress(null, "localhost", 12345, "com.linkedin.events.source1", "com.linkedin.events.source2", "com.linkedin.events.source3");
    builder.setAddress(address);
    ServerInfo si = builder.build();
    assertEquals(12345, si.getAddress().getPort());
    assertEquals(3, si.getSources().size());
    assertEquals("com.linkedin.events.source1", si.getSources().get(0));
    assertEquals("com.linkedin.events.source2", si.getSources().get(1));
    assertEquals("com.linkedin.events.source3", si.getSources().get(2));
}
Also used : ServerInfoBuilder(com.linkedin.databus.client.pub.ServerInfo.ServerInfoBuilder) Test(org.testng.annotations.Test)

Aggregations

ServerInfoBuilder (com.linkedin.databus.client.pub.ServerInfo.ServerInfoBuilder)11 ServerInfo (com.linkedin.databus.client.pub.ServerInfo)5 DatabusHttpClientImpl (com.linkedin.databus.client.DatabusHttpClientImpl)3 RuntimeConfigBuilder (com.linkedin.databus.client.DatabusHttpClientImpl.RuntimeConfigBuilder)3 ProcessorRegistrationConflictException (com.linkedin.databus2.core.container.request.ProcessorRegistrationConflictException)3 ArrayList (java.util.ArrayList)3 Test (org.testng.annotations.Test)3 DatabusRegistration (com.linkedin.databus.client.pub.DatabusRegistration)2 ConfigLoader (com.linkedin.databus.core.util.ConfigLoader)2 ContainerOperationProcessor (com.linkedin.databus2.core.container.request.ContainerOperationProcessor)2 Properties (java.util.Properties)2 DatabusSourcesConnection (com.linkedin.databus.client.DatabusSourcesConnection)1 ConsumerPauseRequestProcessor (com.linkedin.databus.client.generic.ConsumerPauseRequestProcessor)1 DatabusBootstrapConsumer (com.linkedin.databus.client.pub.DatabusBootstrapConsumer)1 DatabusStreamConsumer (com.linkedin.databus.client.pub.DatabusStreamConsumer)1 ServerInfoSetBuilder (com.linkedin.databus.client.pub.ServerInfo.ServerInfoSetBuilder)1 DatabusV2RegistrationImpl (com.linkedin.databus.client.registration.DatabusV2RegistrationImpl)1 DbusEventBuffer (com.linkedin.databus.core.DbusEventBuffer)1 DbusKeyCompositeFilterConfig (com.linkedin.databus2.core.filter.DbusKeyCompositeFilterConfig)1 HashMap (java.util.HashMap)1