Ejemplo n.º 1
0
  @Test
  public void events() {
    // new host
    testProcessor.process(new TestArpPacketContext(DEV1));
    assertNotNull("new host expected", providerService.added);
    assertNull("host motion unexpected", providerService.moved);

    // the host moved to new switch
    testProcessor.process(new TestArpPacketContext(DEV2));
    assertNotNull("host motion expected", providerService.moved);

    // the host was misheard on a spine
    testProcessor.process(new TestArpPacketContext(DEV3));
    assertNull("host misheard on spine switch", providerService.spine);

    providerService.clear();

    // new host
    testProcessor.process(new TestNaPacketContext(DEV4));
    assertNotNull("new host expected", providerService.added);
    assertNull("host motion unexpected", providerService.moved);

    // the host moved to new switch
    testProcessor.process(new TestNaPacketContext(DEV5));
    assertNotNull("host motion expected", providerService.moved);

    // the host was misheard on a spine
    testProcessor.process(new TestNaPacketContext(DEV6));
    assertNull("host misheard on spine switch", providerService.spine);
  }
Ejemplo n.º 2
0
 @Test
 public void basics() {
   assertNotNull("registration expected", providerService);
   assertEquals("incorrect provider", provider, providerService.provider());
 }