use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv4.routes.FlowspecL3vpnIpv4RoutesBuilder in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testChangedRoutes.
@Test
public void testChangedRoutes() {
final Routes emptyCase = new FlowspecL3vpnIpv4RoutesCaseBuilder().build();
DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode();
Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
final Routes emptyRoutes = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder().build()).build();
tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
final Routes routes = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()).build();
tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
final Collection<DataTreeCandidateNode> result = RIB_SUPPORT.changedRoutes(tree);
Assert.assertFalse(result.isEmpty());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv4.routes.FlowspecL3vpnIpv4RoutesBuilder in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testBuildMpReachNlriUpdate.
@Test
public void testBuildMpReachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(createRoutes(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), Collections.emptyList(), ATTRIBUTES);
final AdvertizedRoutes advertised = update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
assertEquals(REACH_NLRI, advertised.getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes2.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv4.routes.FlowspecL3vpnIpv4RoutesBuilder in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv4.routes.FlowspecL3vpnIpv4RoutesBuilder in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() throws Exception {
final Routes empty = new FlowspecL3vpnIpv4RoutesCaseBuilder().setFlowspecL3vpnIpv4Routes(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv4.routes.FlowspecL3vpnIpv4RoutesBuilder in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testRoutePath.
@Test
public void testRoutePath() {
final YangInstanceIdentifier.NodeIdentifierWithPredicates prefixNii = createRouteNIWP(new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build());
Assert.assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
}
Aggregations