Search in sources :

Example 1 with GlobalAddPathsConfigBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.GlobalAddPathsConfigBuilder in project bgpcep by opendaylight.

the class OpenConfigMappingUtilTest method toPathSelectionMode.

@Test
public void toPathSelectionMode() {
    final List<AfiSafi> families = new ArrayList<>();
    families.add(new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).addAugmentation(new GlobalAddPathsConfigBuilder().setSendMax(N_PATHS).build()).build());
    families.add(new AfiSafiBuilder().setAfiSafiName(IPV6UNICAST.class).addAugmentation(new GlobalAddPathsConfigBuilder().setSendMax(ALL_PATHS).build()).build());
    final Map<BgpTableType, PathSelectionMode> result = OpenConfigMappingUtil.toPathSelectionMode(families, tableTypeRegistry);
    final Map<BgpTableType, PathSelectionMode> expected = new HashMap<>();
    expected.put(new BgpTableTypeImpl(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class), ADD_PATH_BEST_N_PATH_SELECTION);
    expected.put(new BgpTableTypeImpl(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class), ADD_PATH_BEST_ALL_PATH_SELECTION);
    // FIXME: these assertions are wrong, as they perform lookup on non-existing keys
    assertEquals(expected.get(0), result.get(0));
    assertEquals(expected.get(1), result.get(1));
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType) Ipv6AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily) HashMap(java.util.HashMap) Ipv4AddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily) AfiSafi(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi) BgpPeerTest.createAfiSafi(org.opendaylight.protocol.bgp.rib.impl.config.BgpPeerTest.createAfiSafi) ArrayList(java.util.ArrayList) AfiSafiBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder) GlobalAddPathsConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.GlobalAddPathsConfigBuilder) PathSelectionMode(org.opendaylight.protocol.bgp.mode.api.PathSelectionMode) BgpTableTypeImpl(org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl) IPV4UNICAST(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4UNICAST) IPV6UNICAST(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV6UNICAST) UnicastSubsequentAddressFamily(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1 PathSelectionMode (org.opendaylight.protocol.bgp.mode.api.PathSelectionMode)1 BgpTableTypeImpl (org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl)1 BgpPeerTest.createAfiSafi (org.opendaylight.protocol.bgp.rib.impl.config.BgpPeerTest.createAfiSafi)1 AfiSafi (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafi)1 AfiSafiBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder)1 IPV4UNICAST (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4UNICAST)1 IPV6UNICAST (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV6UNICAST)1 BgpTableType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType)1 GlobalAddPathsConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.GlobalAddPathsConfigBuilder)1 Ipv4AddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily)1 Ipv6AddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily)1 UnicastSubsequentAddressFamily (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.UnicastSubsequentAddressFamily)1