use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCMockCommon method createPCCSession.
Future<PCEPSession> createPCCSession(final BigInteger dbVersion) {
final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(this.messageRegistry);
final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf = getSessionNegotiatorFactory();
final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(3, this.localAddress.getAddress(), 0, -1, new HashedWheelTimer(), Optional.absent());
return pccDispatcher.createClient(this.remoteAddress, -1, () -> {
this.pccSessionListener = new PCCSessionListener(1, tunnelManager, false);
return this.pccSessionListener;
}, snf, KeyMapping.getKeyMapping(), this.localAddress, dbVersion);
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testGetId.
@Test
public void testGetId() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
Assert.assertEquals(1, listener.getId());
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testOnSessionDown.
@Test
public void testOnSessionDown() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
listener.onSessionDown(this.mockedSession, new Exception());
verify(this.tunnelManager).onSessionDown(Mockito.any(PCCSession.class));
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testOnSessionUp.
@Test
public void testOnSessionUp() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, false);
listener.onSessionUp(this.mockedSession);
verify(this.tunnelManager).onSessionUp(Mockito.any(PCCSession.class));
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener in project bgpcep by opendaylight.
the class PCCSessionListenerTest method testOnMessageErrorMode.
@Test
public void testOnMessageErrorMode() {
final PCCSessionListener listener = new PCCSessionListener(1, this.tunnelManager, true);
listener.onMessage(this.mockedSession, createUpdMsg(true));
verify(this.mockedSession).sendMessage(Mockito.any(Message.class));
}
Aggregations