use of org.opendaylight.mdsal.binding.dom.adapter.CurrentAdapterSerializer in project bgpcep by opendaylight.
the class ParserToSalTest method setUp.
@Override
@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"), ServiceLoader.load(BGPExtensionConsumerContext.class).findFirst().orElseThrow().getMessageRegistry(), Lists.newArrayList(fixMessages(bgpMessages)));
doReturn(GlobalEventExecutor.INSTANCE.newSucceededFuture(null)).when(this.dispatcher).createReconnectingClient(any(InetSocketAddress.class), any(InetSocketAddress.class), anyInt(), any(KeyMapping.class));
final CurrentAdapterSerializer serializer = mappingService.currentSerializer();
this.baseact.startRIBExtensionProvider(this.ext1, serializer);
this.lsact.startRIBExtensionProvider(this.ext2, serializer);
this.codecsRegistry = new ConstantCodecsRegistry(serializer);
}
use of org.opendaylight.mdsal.binding.dom.adapter.CurrentAdapterSerializer in project bgpcep by opendaylight.
the class AbstractRIBTestSetup method mockRib.
public void mockRib() throws Exception {
final RIBExtensionProviderContext context = new SimpleRIBExtensionProviderContext();
final List<BgpTableType> localTables = new ArrayList<>();
localTables.add(new BgpTableTypeImpl(IPV4_AFI, SAFI));
localTables.add(new BgpTableTypeImpl(IPV6_AFI, SAFI));
final CurrentAdapterSerializer serializer = mappingService.currentSerializer();
this.a1.startRIBExtensionProvider(context, serializer);
mockedMethods();
doReturn(mock(ClusterSingletonServiceRegistration.class)).when(this.clusterSingletonServiceProvider).registerClusterSingletonService(any(ClusterSingletonService.class));
this.rib = new RIBImpl(this.tableRegistry, new RibId("test"), new AsNumber(Uint32.valueOf(5)), RIB_ID, context, this.dispatcher, new ConstantCodecsRegistry(serializer), this.dom, this.policies, localTables, Collections.singletonMap(KEY, BasePathSelectionModeFactory.createBestPathSelectionStrategy()));
}
Aggregations