Search in sources :

Example 1 with MultiPathSupport

use of org.opendaylight.protocol.bgp.parser.spi.MultiPathSupport in project bgpcep by opendaylight.

the class MultiPathSupportImplTest method testIsTableTypeSupported.

@Test
public void testIsTableTypeSupported() {
    final List<AddressFamilies> supportedTables = Lists.newArrayList();
    final BgpTableType ipv4Unicast = new BgpTableTypeImpl(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
    final BgpTableType ipv4L3vpn = new BgpTableTypeImpl(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class);
    final BgpTableType ipv6Unicast = new BgpTableTypeImpl(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class);
    final BgpTableType ipv6L3vpn = new BgpTableTypeImpl(Ipv6AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class);
    supportedTables.add(createAddPathCapability(ipv4Unicast, SendReceive.Send));
    supportedTables.add(createAddPathCapability(ipv4L3vpn, SendReceive.Receive));
    supportedTables.add(createAddPathCapability(ipv6Unicast, SendReceive.Both));
    final MultiPathSupport multiPathSupport = MultiPathSupportImpl.createParserMultiPathSupport(supportedTables);
    Assert.assertTrue(multiPathSupport.isTableTypeSupported(ipv4Unicast));
    Assert.assertTrue(multiPathSupport.isTableTypeSupported(ipv6Unicast));
    Assert.assertFalse(multiPathSupport.isTableTypeSupported(ipv4L3vpn));
    Assert.assertFalse(multiPathSupport.isTableTypeSupported(ipv6L3vpn));
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) AddressFamilies(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.add.path.capability.AddressFamilies) MultiPathSupport(org.opendaylight.protocol.bgp.parser.spi.MultiPathSupport) BgpTableTypeImpl(org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BgpTableTypeImpl (org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl)1 MultiPathSupport (org.opendaylight.protocol.bgp.parser.spi.MultiPathSupport)1 BgpTableType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType)1 AddressFamilies (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.add.path.capability.AddressFamilies)1