Search in sources :

Example 1 with BGPStateCollector

use of org.opendaylight.protocol.bgp.rib.impl.state.BGPStateCollector in project bgpcep by opendaylight.

the class RibImplTest method testRibImpl.

@Test
public void testRibImpl() throws ExecutionException, InterruptedException {
    final RibImpl ribImpl = new RibImpl(extension, dispatcher, policyProvider, codecsRegistry, new BGPStateCollector(), domDataBroker);
    ribImpl.start(createGlobal(), "rib-test", tableTypeRegistry);
    verify(domDataBroker).getExtensions();
    assertEquals("RIBImpl{bgpId=Ipv4Address{_value=127.0.0.1}, localTables=[BgpTableTypeImpl [" + "getAfi()=interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types." + "rev200120.Ipv4AddressFamily, " + "getSafi()=interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types." + "rev200120.UnicastSubsequentAddressFamily]]}", ribImpl.toString());
    assertEquals(Collections.singleton(new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class)), ribImpl.getLocalTablesKeys());
    assertNotNull(ribImpl.getService());
    assertNotNull(ribImpl.getInstanceIdentifier());
    assertEquals(AS, ribImpl.getLocalAs());
    assertEquals(BGP_ID, ribImpl.getBgpIdentifier());
    assertEquals(Collections.singleton(TABLE_TYPE), ribImpl.getLocalTables());
    assertEquals(dispatcher, ribImpl.getDispatcher());
    assertEquals(extension, ribImpl.getRibExtensions());
    assertNotNull(ribImpl.getRibSupportContext());
    assertNotNull(ribImpl.getCodecsRegistry());
    ribImpl.stop().get();
}
Also used : TablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey) BGPStateCollector(org.opendaylight.protocol.bgp.rib.impl.state.BGPStateCollector) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BGPStateCollector (org.opendaylight.protocol.bgp.rib.impl.state.BGPStateCollector)1 TablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey)1