Search in sources :

Example 1 with BGPMock

use of org.opendaylight.protocol.bgp.rib.mock.BGPMock in project bgpcep by opendaylight.

the class ParserToSalTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    final String hexMessages = "/bgp_hex.txt";
    final List<byte[]> bgpMessages = HexDumpBGPFileParser.parseMessages(ParserToSalTest.class.getResourceAsStream(hexMessages));
    this.mock = new BGPMock(new EventBus("test"), ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getMessageRegistry(), Lists.newArrayList(fixMessages(bgpMessages)));
    Mockito.doReturn(GlobalEventExecutor.INSTANCE.newSucceededFuture(null)).when(this.dispatcher).createReconnectingClient(Mockito.any(InetSocketAddress.class), Mockito.anyInt(), Mockito.any(KeyMapping.class));
    this.ext1 = new SimpleRIBExtensionProviderContext();
    this.ext2 = new SimpleRIBExtensionProviderContext();
    this.baseact = new RIBActivator();
    this.lsact = new org.opendaylight.protocol.bgp.linkstate.impl.RIBActivator();
    this.baseact.startRIBExtensionProvider(this.ext1);
    this.lsact.startRIBExtensionProvider(this.ext2);
    this.codecsRegistry = CodecsRegistryImpl.create(this.bindingCodecTreeFactory, GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
}
Also used : RIBActivator(org.opendaylight.protocol.bgp.inet.RIBActivator) InetSocketAddress(java.net.InetSocketAddress) EventBus(com.google.common.eventbus.EventBus) SimpleRIBExtensionProviderContext(org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext) KeyMapping(org.opendaylight.protocol.concepts.KeyMapping) BGPMock(org.opendaylight.protocol.bgp.rib.mock.BGPMock) Before(org.junit.Before)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 InetSocketAddress (java.net.InetSocketAddress)1 Before (org.junit.Before)1 RIBActivator (org.opendaylight.protocol.bgp.inet.RIBActivator)1 BGPMock (org.opendaylight.protocol.bgp.rib.mock.BGPMock)1 SimpleRIBExtensionProviderContext (org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext)1 KeyMapping (org.opendaylight.protocol.concepts.KeyMapping)1