Package com.linkedin.databus.client.pub.ServerInfo

Examples of com.linkedin.databus.client.pub.ServerInfo.ServerInfoBuilder


  }

  @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));
View Full Code Here


  }

    @Test
    public void testBuilderSetAddressWithName() throws Exception
    {
      ServerInfoBuilder builder = new ServerInfoBuilder();
      String address = ServerInfoBuilder.generateAddress("SeRvEr", "localhost", 99,
                                                         "com.linkedin.events.source1",
                                                         "com.linkedin.events.source3");
      builder.setAddress(address);
      ServerInfo si = builder.build();
      assertEquals("SeRvEr", si.getName());
      assertEquals(99, si.getAddress().getPort());
      assertEquals(2, si.getSources().size());
      assertEquals("com.linkedin.events.source1", si.getSources().get(0));
      assertEquals("com.linkedin.events.source3", si.getSources().get(1));
View Full Code Here

    }

    @Test
    public void testServerInfoSetBuilder() throws Exception
    {
      ServerInfoBuilder sib = new ServerInfoBuilder();
      String address1 = ServerInfoBuilder.generateAddress("SeRvEr1", "localhost", 98,
                                                         "com.linkedin.events.source1",
                                                         "com.linkedin.events.source3");
      sib.setAddress(address1);
      ServerInfo si1 = sib.build();

      String address2 = ServerInfoBuilder.generateAddress("SeRvEr2", "localhost", 99,
                                                          "com.linkedin.events.source1",
                                                          "com.linkedin.events.source3");
      sib.setAddress(address2);
      ServerInfo si2 = sib.build();

      String address3 = ServerInfoBuilder.generateAddress(null, "localhost", 100,
                                                         "com.linkedin.events.source1",
                                                         "com.linkedin.events.source2",
                                                         "com.linkedin.events.source3");
      sib.setAddress(address3);
      ServerInfo si3 = sib.build();

      ServerInfoSetBuilder builder = new ServerInfoSetBuilder();
      builder.setServers(address1 + ServerInfoSetBuilder.SERVER_INFO_SEPARATOR + address2 +
                         ServerInfoSetBuilder.SERVER_INFO_SEPARATOR + address3);
      List<ServerInfo> res = builder.build();
View Full Code Here

TOP

Related Classes of com.linkedin.databus.client.pub.ServerInfo.ServerInfoBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.