@Test
public void testEmptyRoute() {
- final Routes empty = new EvpnRoutesCaseBuilder().setEvpnRoutes(
- new EvpnRoutesBuilder().setEvpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new FlowspecRoutesCaseBuilder().setFlowspecRoutes(
- new FlowspecRoutesBuilder().setFlowspecRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new FlowspecIpv6RoutesCaseBuilder().setFlowspecIpv6Routes(
- new FlowspecIpv6RoutesBuilder().setFlowspecRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(
- new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new FlowspecL3vpnIpv6RoutesCaseBuilder().setFlowspecL3vpnIpv6Routes(
- new FlowspecL3vpnIpv6RoutesBuilder().setFlowspecL3vpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
.setPrefix(PREFIX).build();
private static final Ipv4Routes ROUTES = new Ipv4RoutesBuilder()
.setIpv4Route(Collections.singletonList(ROUTE)).build();
- private static final Ipv4Routes EMPTY_ROUTES = new Ipv4RoutesBuilder()
- .setIpv4Route(Collections.emptyList()).build();
@Override
public void setUp() throws Exception {
@Test
public void testEmptyRoute() {
- final Routes empty = new Ipv4RoutesCaseBuilder().setIpv4Routes(EMPTY_ROUTES).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
.setPrefix(PREFIX).build();
private static final Ipv6Routes ROUTES = new Ipv6RoutesBuilder()
.setIpv6Route(Collections.singletonList(ROUTE)).build();
- private static final Ipv6Routes EMPTY_ROUTES = new Ipv6RoutesBuilder()
- .setIpv6Route(Collections.emptyList()).build();
+ private static final Ipv6Routes EMPTY_ROUTES = new Ipv6RoutesBuilder().build();
@Override
public void setUp() throws Exception {
@Test
public void testEmptyRoute() {
- final Routes empty = new Ipv6RoutesCaseBuilder().setIpv6Routes(EMPTY_ROUTES).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new L3vpnMcastRoutesIpv4CaseBuilder()
- .setL3vpnMcastRoutesIpv4(new L3vpnMcastRoutesIpv4Builder()
- .setL3vpnMcastRoute(Collections.emptyList()).build()).build();
- Assert.assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ Assert.assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new L3vpnMcastRoutesIpv6CaseBuilder()
- .setL3vpnMcastRoutesIpv6(new L3vpnMcastRoutesIpv6Builder()
- .setL3vpnMcastRoute(Collections.emptyList()).build()).build();
- Assert.assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ Assert.assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder()
- .setVpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder()
- .setVpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new LabeledUnicastRoutesCaseBuilder().setLabeledUnicastRoutes(
- new LabeledUnicastRoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new LabeledUnicastIpv6RoutesCaseBuilder().setLabeledUnicastIpv6Routes(
- new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new LinkstateRoutesCaseBuilder().setLinkstateRoutes(
- new LinkstateRoutesBuilder().setLinkstateRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new MvpnRoutesIpv4CaseBuilder().setMvpnRoutesIpv4(new MvpnRoutesIpv4Builder()
- .setMvpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new MvpnRoutesIpv6CaseBuilder().setMvpnRoutesIpv6(new MvpnRoutesIpv6Builder()
- .setMvpnRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
@Test
public void testEmptyRoute() {
- final Routes empty = new RouteTargetConstrainRoutesCaseBuilder()
- .setRouteTargetConstrainRoutes(new RouteTargetConstrainRoutesBuilder()
- .setRouteTargetConstrainRoute(Collections.emptyList()).build()).build();
- assertEquals(createEmptyTable(empty), this.ribSupport.emptyTable());
+ assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
}
@Test
if (table.getDataBefore() == null) {
tx.put(LogicalDatastoreType.OPERATIONAL, tablePath, new TablesBuilder()
.setAfi(tableKey.getAfi()).setSafi(tableKey.getSafi())
- .setRoutes(this.registry.getRIBSupport(tableKey).emptyRoutesCase())
.setAttributes(newTable.getAttributes()).build());
}
this.tk = new TablesKey(afiClass, safiClass);
this.emptyTable = (MapEntryNode) this.mappingService
.toNormalizedNode(TABLES_II, new TablesBuilder().withKey(tk)
- .setRoutes(emptyRoutesCase())
.setAttributes(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib
.rev180329.rib.tables.AttributesBuilder().build()).build()).getValue();
this.afiClass = afiClass;
* @return Protocol-specific case in the routes choice, may not be null.
*/
@Nonnull
+ @Deprecated
C emptyRoutesCase();
/**
return (ContainerNode) this.mappingService.toNormalizedNode(ATTRIBUTES_IID, ATTRIBUTES).getValue();
}
- protected final MapEntryNode createEmptyTable(final Routes routes) {
+ protected final MapEntryNode createEmptyTable() {
final Tables tables = new TablesBuilder().withKey(getTablesKey())
- .setAttributes(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329
- .rib.tables.AttributesBuilder().build())
- .setRoutes(routes).build();
+ .setAttributes(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329
+ .rib.tables.AttributesBuilder().build()).build();
return (MapEntryNode) this.mappingService.toNormalizedNode(tablesIId(), tables).getValue();
}
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path
.attributes.Attributes.class).augmentation(Attributes2.class).child(MpUnreachNlri.class);
private static final NodeIdentifier BGP_ROUTES_NODE_ID = new NodeIdentifier(BMP_ROUTES_QNAME);
- private static final NodeIdentifier ROUTES_NODE_ID = new NodeIdentifier(Routes.QNAME);
private final YangInstanceIdentifier tableId;
private final RIBSupport tableSupport;
for (final Map.Entry<QName, Object> e : tableKey.getKeyValues().entrySet()) {
tb.withChild(ImmutableNodes.leafNode(e.getKey(), e.getValue()));
}
- final ChoiceNode routes
- = (ChoiceNode) this.tableSupport.emptyTable().getChild(ROUTES_NODE_ID).get();
tx.put(LogicalDatastoreType.OPERATIONAL, this.tableId,
- tb.withChild(ImmutableChoiceNodeBuilder.create(routes).withNodeIdentifier(
+ tb.withChild(ImmutableChoiceNodeBuilder.create().withNodeIdentifier(
new NodeIdentifier(TablesUtil.BMP_ROUTES_QNAME)).build()).build());
}
readDataOperational(getDataBroker(), routerIId, router -> {
final List<Peer> peers = router.getPeer();
+ assertNotNull(peers.size());
assertEquals(1, peers.size());
final Peer peer = peers.get(0);
assertEquals(PeerType.Global, peer.getType());
assertEquals(Ipv4AddressFamily.class, prePolicyTable.getAfi());
assertEquals(UnicastSubsequentAddressFamily.class, prePolicyTable.getSafi());
assertFalse(prePolicyTable.getAttributes().isUptodate());
- assertNotNull(prePolicyTable.getRoutes());
assertNotNull(peer.getPostPolicyRib());
assertEquals(1, peer.getPostPolicyRib().getTables().size());
assertEquals(Ipv4AddressFamily.class, postPolicyTable.getAfi());
assertEquals(UnicastSubsequentAddressFamily.class, postPolicyTable.getSafi());
assertFalse(postPolicyTable.getAttributes().isUptodate());
- assertNotNull(postPolicyTable.getRoutes());
assertNotNull(peer.getPeerSession());
final PeerSession peerSession = peer.getPeerSession();
package org.opendaylight.protocol.bmp.impl.session;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;