コード例 #1
0
  @Test
  public void testIgnoresChanges() throws Exception {
    List<ServiceEndPoint> endPoints = Lists.newArrayList(FOO);
    FixedHostDiscovery discovery = new FixedHostDiscovery(endPoints);

    // Change the backing list, verify it doesn't affect FixedHostDiscovery
    endPoints.remove(FOO);
    assertEquals(1, Iterables.size(discovery.getHosts()));

    endPoints.add(BAR);
    assertEquals(1, Iterables.size(discovery.getHosts()));
  }
コード例 #2
0
 @Test
 public void testAddListener() {
   // Verify it doesn't blow up
   _discovery.addListener(null);
 }
コード例 #3
0
 @Test
 public void testRemoveListener() {
   // Verify it doesn't blow up
   _discovery.removeListener(null);
 }
コード例 #4
0
 @Test
 public void testClose() throws IOException {
   _discovery.close();
 }