Search in sources :

Example 1 with SimpleBGPTableTypeRegistryProvider

use of org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider in project bgpcep by opendaylight.

the class TableTypeActivatorTest method testActivator.

@Test
public void testActivator() {
    final TableTypeActivator tableTypeActivator = new TableTypeActivator();
    final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
    tableTypeActivator.startBGPTableTypeRegistryProvider(registry);
    final Optional<Class<? extends AfiSafiType>> afiSafiType = registry.getAfiSafiType(IPV4);
    Assert.assertEquals(IPV4LABELLEDUNICAST.class, afiSafiType.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType2 = registry.getAfiSafiType(IPV6);
    Assert.assertEquals(IPV6LABELLEDUNICAST.class, afiSafiType2.get());
    final Optional<BgpTableType> tableType = registry.getTableType(IPV4LABELLEDUNICAST.class);
    Assert.assertEquals(IPV4, tableType.get());
    final Optional<BgpTableType> tableType2 = registry.getTableType(IPV6LABELLEDUNICAST.class);
    Assert.assertEquals(IPV6, tableType2.get());
    tableTypeActivator.stopBGPTableTypeRegistryProvider();
    tableTypeActivator.close();
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) SimpleBGPTableTypeRegistryProvider(org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider) AfiSafiType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType) Test(org.junit.Test)

Example 2 with SimpleBGPTableTypeRegistryProvider

use of org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider in project bgpcep by opendaylight.

the class TableTypeActivatorTest method testActivator.

@Test
public void testActivator() {
    final TableTypeActivator tableTypeActivator = new TableTypeActivator();
    final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
    tableTypeActivator.startBGPTableTypeRegistryProvider(registry);
    final Optional<Class<? extends AfiSafiType>> afiSafiType = registry.getAfiSafiType(EVPN);
    Assert.assertEquals(L2VPNEVPN.class, afiSafiType.get());
    final Optional<BgpTableType> tableType = registry.getTableType(L2VPNEVPN.class);
    Assert.assertEquals(EVPN, tableType.get());
    tableTypeActivator.stopBGPTableTypeRegistryProvider();
    tableTypeActivator.close();
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) SimpleBGPTableTypeRegistryProvider(org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider) AfiSafiType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType) Test(org.junit.Test)

Example 3 with SimpleBGPTableTypeRegistryProvider

use of org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider in project bgpcep by opendaylight.

the class TableTypeActivatorTest method testActivator.

@Test
public void testActivator() {
    final TableTypeActivator tableTypeActivator = new TableTypeActivator();
    final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
    tableTypeActivator.startBGPTableTypeRegistryProvider(registry);
    final Optional<Class<? extends AfiSafiType>> afiSafiType = registry.getAfiSafiType(IPV4_FLOW);
    Assert.assertEquals(IPV4FLOW.class, afiSafiType.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType2 = registry.getAfiSafiType(IPV6_FLOW);
    Assert.assertEquals(IPV6FLOW.class, afiSafiType2.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType3 = registry.getAfiSafiType(IPV4_VPN_FLOW);
    Assert.assertEquals(IPV4L3VPNFLOW.class, afiSafiType3.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType4 = registry.getAfiSafiType(IPV6_VPN_FLOW);
    Assert.assertEquals(IPV6L3VPNFLOW.class, afiSafiType4.get());
    final Optional<BgpTableType> tableType = registry.getTableType(IPV4FLOW.class);
    Assert.assertEquals(IPV4_FLOW, tableType.get());
    final Optional<BgpTableType> tableType2 = registry.getTableType(IPV6FLOW.class);
    Assert.assertEquals(IPV6_FLOW, tableType2.get());
    final Optional<BgpTableType> tableType3 = registry.getTableType(IPV4L3VPNFLOW.class);
    Assert.assertEquals(IPV4_VPN_FLOW, tableType3.get());
    final Optional<BgpTableType> tableType4 = registry.getTableType(IPV6L3VPNFLOW.class);
    Assert.assertEquals(IPV6_VPN_FLOW, tableType4.get());
    tableTypeActivator.stopBGPTableTypeRegistryProvider();
    tableTypeActivator.close();
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) SimpleBGPTableTypeRegistryProvider(org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider) AfiSafiType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType) Test(org.junit.Test)

Example 4 with SimpleBGPTableTypeRegistryProvider

use of org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider in project bgpcep by opendaylight.

the class TableTypeActivatorTest method testActivator.

@Test
public void testActivator() {
    final TableTypeActivator tableTypeActivator = new TableTypeActivator();
    final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
    tableTypeActivator.startBGPTableTypeRegistryProvider(registry);
    final Optional<Class<? extends AfiSafiType>> afiSafiType = registry.getAfiSafiType(IPV4);
    assertEquals(IPV4UNICAST.class, afiSafiType.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType2 = registry.getAfiSafiType(IPV6);
    assertEquals(IPV6UNICAST.class, afiSafiType2.get());
    final Optional<BgpTableType> tableType = registry.getTableType(IPV4UNICAST.class);
    assertEquals(IPV4, tableType.get());
    final Optional<BgpTableType> tableType2 = registry.getTableType(IPV6UNICAST.class);
    assertEquals(IPV6, tableType2.get());
    tableTypeActivator.stopBGPTableTypeRegistryProvider();
    tableTypeActivator.close();
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) SimpleBGPTableTypeRegistryProvider(org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider) AfiSafiType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType) Test(org.junit.Test)

Example 5 with SimpleBGPTableTypeRegistryProvider

use of org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider in project bgpcep by opendaylight.

the class TableTypeActivatorTest method testActivator.

@Test
public void testActivator() {
    final TableTypeActivator tableTypeActivator = new TableTypeActivator();
    final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
    tableTypeActivator.startBGPTableTypeRegistryProvider(registry);
    final Optional<Class<? extends AfiSafiType>> afiSafiType = registry.getAfiSafiType(IPV4);
    Assert.assertEquals(L3VPNIPV4UNICAST.class, afiSafiType.get());
    final Optional<Class<? extends AfiSafiType>> afiSafiType2 = registry.getAfiSafiType(IPV6);
    Assert.assertEquals(L3VPNIPV6UNICAST.class, afiSafiType2.get());
    final Optional<BgpTableType> tableType = registry.getTableType(L3VPNIPV4UNICAST.class);
    Assert.assertEquals(IPV4, tableType.get());
    final Optional<BgpTableType> tableType2 = registry.getTableType(L3VPNIPV6UNICAST.class);
    Assert.assertEquals(IPV6, tableType2.get());
    tableTypeActivator.stopBGPTableTypeRegistryProvider();
    tableTypeActivator.close();
}
Also used : BgpTableType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType) SimpleBGPTableTypeRegistryProvider(org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider) AfiSafiType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 SimpleBGPTableTypeRegistryProvider (org.opendaylight.protocol.bgp.openconfig.spi.SimpleBGPTableTypeRegistryProvider)6 AfiSafiType (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType)6 BgpTableType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.BgpTableType)6 TableTypeActivator (org.opendaylight.protocol.bgp.linkstate.impl.TableTypeActivator)1