Ejemplo n.º 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()));
  }
Ejemplo n.º 2
0
 @Test
 public void testAddListener() {
   // Verify it doesn't blow up
   _discovery.addListener(null);
 }
Ejemplo n.º 3
0
 @Test
 public void testRemoveListener() {
   // Verify it doesn't blow up
   _discovery.removeListener(null);
 }
Ejemplo n.º 4
0
 @Test
 public void testClose() throws IOException {
   _discovery.close();
 }