import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
import org.opendaylight.protocol.bgp.rib.mock.BGPMock;
import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBExtensionProviderActivator;
-import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
import org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext;
import org.opendaylight.protocol.bgp.util.HexDumpBGPFileParser;
private static final TablesKey TABLE_KEY
= new TablesKey(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class);
private static final InstanceIdentifier<BgpRib> BGP_IID = InstanceIdentifier.create(BgpRib.class);
+ private final IpAddress localAddress = new IpAddress(new Ipv4Address("127.0.0.1"));
private BGPMock mock;
private AbstractRIBExtensionProviderActivator baseact, lsact;
private RIBExtensionProviderContext ext1, ext2;
- private final IpAddress localAddress = new IpAddress(new Ipv4Address("127.0.0.1"));
-
@Mock
private BGPDispatcher dispatcher;
- private final BGPPeerTracker peerTracker = new BGPPeerTrackerImpl();
private CodecsRegistryImpl codecsRegistry;
@Before
final List<BgpTableType> tables = ImmutableList.of(new BgpTableTypeImpl(LinkstateAddressFamily.class,
LinkstateSubsequentAddressFamily.class));
- final RIBImpl rib = new RIBImpl(new RibId(TEST_RIB_ID), AS_NUMBER, BGP_ID, this.ext2, this.dispatcher,
- this.codecsRegistry, getDomBroker(), getDataBroker(), this.policies, this.peerTracker, tables,
- Collections.singletonMap(TABLE_KEY, BasePathSelectionModeFactory
- .createBestPathSelectionStrategy(this.peerTracker)));
+ final RIBImpl rib = new RIBImpl(this.tableRegistry, new RibId(TEST_RIB_ID), AS_NUMBER, BGP_ID, this.ext2,
+ this.dispatcher, this.codecsRegistry, getDomBroker(), getDataBroker(), this.policies,
+ tables, Collections.singletonMap(TABLE_KEY, BasePathSelectionModeFactory
+ .createBestPathSelectionStrategy()));
rib.instantiateServiceInstance();
assertTablesExists(tables);
rib.onGlobalContextUpdated(this.schemaService.getGlobalContext());
- final BGPPeer peer = new BGPPeer(this.localAddress, rib, PeerRole.Ibgp, null, Collections.emptySet(),
- Collections.emptySet());
+ final BGPPeer peer = AbstractAddPathTest.configurePeer(this.tableRegistry, this.localAddress.getIpv4Address(),
+ rib, null, PeerRole.Ibgp, new StrictBGPPeerRegistry());
peer.instantiateServiceInstance();
final ListenerRegistration<?> reg = this.mock.registerUpdateListener(peer);
reg.close();
public void testWithoutLinkstate() throws ReadFailedException {
final List<BgpTableType> tables = ImmutableList.of(new BgpTableTypeImpl(Ipv4AddressFamily.class,
UnicastSubsequentAddressFamily.class));
- final RIBImpl rib = new RIBImpl(new RibId(TEST_RIB_ID), AS_NUMBER, BGP_ID, this.ext1, this.dispatcher,
- this.codecsRegistry, getDomBroker(), getDataBroker(), this.policies, this.peerTracker, tables,
- Collections.singletonMap(TABLE_KEY, BasePathSelectionModeFactory
- .createBestPathSelectionStrategy(this.peerTracker)));
+ final RIBImpl rib = new RIBImpl(this.tableRegistry, new RibId(TEST_RIB_ID), AS_NUMBER, BGP_ID, this.ext1,
+ this.dispatcher, this.codecsRegistry, getDomBroker(), getDataBroker(), this.policies,
+ tables, Collections.singletonMap(TABLE_KEY,
+ BasePathSelectionModeFactory.createBestPathSelectionStrategy()));
rib.instantiateServiceInstance();
rib.onGlobalContextUpdated(this.schemaService.getGlobalContext());
assertTablesExists(tables);
- final BGPPeer peer = new BGPPeer(this.localAddress, rib, PeerRole.Ibgp, null, Collections.emptySet(),
- Collections.emptySet());
+ final BGPPeer peer = AbstractAddPathTest.configurePeer(this.tableRegistry, this.localAddress.getIpv4Address(),
+ rib, null, PeerRole.Ibgp, new StrictBGPPeerRegistry());
peer.instantiateServiceInstance();
final ListenerRegistration<?> reg = this.mock.registerUpdateListener(peer);
reg.close();
for (final Tables table : tables) {
if (table.getAfi().equals(tableType.getAfi()) && table.getSafi().equals(tableType.getSafi())) {
found = true;
- assertEquals(Boolean.valueOf(true), table.getAttributes().isUptodate());
+ assertEquals(Boolean.TRUE, table.getAttributes().isUptodate());
}
}
assertTrue(found);