Search in sources :

Example 1 with BGPActivator

use of org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator in project bgpcep by opendaylight.

the class SrAttributeParserTest method setUp.

@Before
public void setUp() throws Exception {
    final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
    final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
    act.start(context);
}
Also used : SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) BGPActivator(org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator) Before(org.junit.Before)

Example 2 with BGPActivator

use of org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator in project bgpcep by opendaylight.

the class ActivatorTest method testActivator.

@Test
public void testActivator() throws Exception {
    final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
    final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
    assertNull(context.getAddressFamilyRegistry().classForFamily(16388));
    assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(71));
    act.start(context);
    assertEquals(LinkstateAddressFamily.class, context.getAddressFamilyRegistry().classForFamily(16388));
    assertEquals(LinkstateSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(71));
    act.close();
}
Also used : SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) BGPActivator(org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator) Test(org.junit.Test)

Example 3 with BGPActivator

use of org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator in project bgpcep by opendaylight.

the class LinkstateNlriParserTest method setUp.

private void setUp(final byte[] data) throws BGPParsingException {
    final LinkstateNlriParser parser = new LinkstateNlriParser();
    final MpReachNlriBuilder builder = new MpReachNlriBuilder();
    this.registry = SimpleNlriTypeRegistry.getInstance();
    final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
    final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
    act.start(context);
    parser.parseNlri(Unpooled.copiedBuffer(data), builder);
    final DestinationLinkstate ls = ((DestinationLinkstateCase) builder.getAdvertizedRoutes().getDestinationType()).getDestinationLinkstate();
    assertEquals(1, ls.getCLinkstateDestination().size());
    this.dest = ls.getCLinkstateDestination().get(0);
}
Also used : MpReachNlriBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpReachNlriBuilder) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) DestinationLinkstate(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.linkstate._case.DestinationLinkstate) BGPActivator(org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator) LinkstateNlriParser(org.opendaylight.protocol.bgp.linkstate.impl.nlri.LinkstateNlriParser) DestinationLinkstateCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationLinkstateCase)

Aggregations

BGPActivator (org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator)3 BGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext)3 SimpleBGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext)3 Before (org.junit.Before)1 Test (org.junit.Test)1 LinkstateNlriParser (org.opendaylight.protocol.bgp.linkstate.impl.nlri.LinkstateNlriParser)1 DestinationLinkstateCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationLinkstateCase)1 DestinationLinkstate (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.linkstate._case.DestinationLinkstate)1 MpReachNlriBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpReachNlriBuilder)1