use of org.opendaylight.protocol.pcep.spi.MessageRegistry in project bgpcep by opendaylight.
the class PCEPDispatcherImplTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
final List<PCEPCapability> capList = new ArrayList<>();
final PCEPSessionProposalFactory sessionProposal = new BasePCEPSessionProposalFactory(DEAD_TIMER, KEEP_ALIVE, capList);
final EventLoopGroup eventLoopGroup;
if (Epoll.isAvailable()) {
eventLoopGroup = new EpollEventLoopGroup();
} else {
eventLoopGroup = new NioEventLoopGroup();
}
final MessageRegistry msgReg = ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry();
this.dispatcher = new PCEPDispatcherImpl(msgReg, new DefaultPCEPSessionNegotiatorFactory(sessionProposal, 0), eventLoopGroup, eventLoopGroup);
doReturn(KeyMapping.getKeyMapping()).when(this.dispatcherDependencies).getKeys();
doReturn(null).when(this.dispatcherDependencies).getPeerProposal();
doReturn("mockChannel").when(this.mockChannel).toString();
final PCEPDispatcherImpl dispatcher2 = new PCEPDispatcherImpl(msgReg, new DefaultPCEPSessionNegotiatorFactory(sessionProposal, 0), eventLoopGroup, eventLoopGroup);
this.disp2Spy = Mockito.spy(dispatcher2);
this.pccMock = new PCCMock(new DefaultPCEPSessionNegotiatorFactory(sessionProposal, 0), new PCEPHandlerFactory(msgReg));
}
Aggregations