Search in sources :

Example 1 with VpnIpv4RoutesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder in project bgpcep by opendaylight.

the class VpnIpv4RIBSupportTest method testChangedRoutes.

@Test
public void testChangedRoutes() {
    final Routes emptyCase = new VpnIpv4RoutesCaseBuilder().build();
    DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode();
    assertTrue(this.ribSupport.changedRoutes(tree).isEmpty());
    final Routes emptyRoutes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder().build()).build();
    tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
    assertTrue(this.ribSupport.changedRoutes(tree).isEmpty());
    final Routes routes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(ROUTES).build();
    tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
    final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
    Assert.assertFalse(result.isEmpty());
}
Also used : VpnIpv4RoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder) DataTreeCandidateNode(org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode) VpnIpv4Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4Routes) Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes) VpnIpv4RoutesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.bgp.rib.rib.loc.rib.tables.routes.VpnIpv4RoutesCaseBuilder) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 2 with VpnIpv4RoutesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder in project bgpcep by opendaylight.

the class VpnIpv4RIBSupportTest method testChangedRoutes.

@Test
public void testChangedRoutes() {
    final Routes emptyCase = new VpnIpv4RoutesCaseBuilder().build();
    DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode();
    assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
    final Routes emptyRoutes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder().build()).build();
    tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
    assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
    final Routes routes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(ROUTES).build();
    tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
    final Collection<DataTreeCandidateNode> result = RIB_SUPPORT.changedRoutes(tree);
    Assert.assertFalse(result.isEmpty());
}
Also used : VpnIpv4RoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder) DataTreeCandidateNode(org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode) Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes) VpnIpv4Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4Routes) VpnIpv4RoutesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.bgp.rib.rib.loc.rib.tables.routes.VpnIpv4RoutesCaseBuilder) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 3 with VpnIpv4RoutesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder in project bgpcep by opendaylight.

the class VpnIpv4RIBSupportTest method testEmptyRoute.

@Test
public void testEmptyRoute() {
    final Routes empty = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder().setVpnRoute(Collections.emptyList()).build()).build();
    final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
    assertEquals(createRoutes(empty), emptyRoutes);
}
Also used : VpnIpv4RoutesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder) ChoiceNode(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes) VpnIpv4Routes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4Routes) VpnIpv4RoutesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.bgp.rib.rib.loc.rib.tables.routes.VpnIpv4RoutesCaseBuilder) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 AbstractRIBSupportTest (org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest)3 Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes)2 VpnIpv4RoutesCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.bgp.rib.rib.loc.rib.tables.routes.VpnIpv4RoutesCaseBuilder)2 VpnIpv4Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4Routes)2 VpnIpv4RoutesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder)2 DataTreeCandidateNode (org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode)2 Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes)1 VpnIpv4RoutesCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.bgp.rib.rib.loc.rib.tables.routes.VpnIpv4RoutesCaseBuilder)1 VpnIpv4Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4Routes)1 VpnIpv4RoutesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4RoutesBuilder)1 ChoiceNode (org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode)1