use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal in project bgpcep by opendaylight.
the class PCCSyncAvoidanceProcedureTest method testSessionAvoidanceDesynchronizedEstablishment.
@Test
public void testSessionAvoidanceDesynchronizedEstablishment() throws Exception {
final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
final PCEPSession session = createPCCSession(BigInteger.TEN).get();
assertNotNull(session);
final TestingSessionListener pceSessionListener = getListener(factory);
assertNotNull(pceSessionListener);
assertNotNull(pceSessionListener.getSession());
checkResyncSession(Optional.absent(), 11, 11, null, BigInteger.valueOf(10), pceSessionListener);
channel.close().get();
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal in project bgpcep by opendaylight.
the class PCCTriggeredFullDBResyncTest method testSessionTriggeredFullDBReSync.
@Test
public void testSessionTriggeredFullDBReSync() throws Exception {
final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
final int lspQuantity = 3;
final BigInteger numberOflspAndDBv = BigInteger.valueOf(lspQuantity);
final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
assertNotNull(session);
final TestingSessionListener pceSessionListener = getListener(factory);
assertNotNull(pceSessionListener);
checkSynchronizedSession(lspQuantity, pceSessionListener, numberOflspAndDBv);
this.pccSessionListener.onMessage(session, createTriggerLspResync());
final TestingSessionListener sessionListenerAfterReconnect = getListener(factory);
checkResyncSession(Optional.of(lspQuantity), 4, 8, null, numberOflspAndDBv, sessionListenerAfterReconnect);
channel.close().get();
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal in project bgpcep by opendaylight.
the class PCCTriggeredSyncTest method testSessionTriggeredSync.
@Test
public void testSessionTriggeredSync() throws Exception {
final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
final BigInteger numberOflspAndDBv = BigInteger.valueOf(3);
final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
assertNotNull(session);
final TestingSessionListener pceSessionListener = getListener(factory);
assertNotNull(pceSessionListener);
checkSynchronizedSession(0, pceSessionListener, BigInteger.ZERO);
this.pccSessionListener.onMessage(session, createTriggerMsg());
checkSynchronizedSession(3, pceSessionListener, numberOflspAndDBv);
channel.close().get();
}
use of org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal in project bgpcep by opendaylight.
the class PCCTriggeredLspResyncTest method testSessionTriggeredLspReSync.
@Test
public void testSessionTriggeredLspReSync() throws Exception {
final TestingSessionListenerFactory factory = new TestingSessionListenerFactory();
final int lspQuantity = 3;
final BigInteger numberOflspAndDBv = BigInteger.valueOf(lspQuantity);
final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal());
final PCEPSession session = createPCCSession(numberOflspAndDBv).get();
assertNotNull(session);
final TestingSessionListener pceSessionListener = getListener(factory);
assertNotNull(pceSessionListener);
checkSynchronizedSession(lspQuantity, pceSessionListener, numberOflspAndDBv);
this.pccSessionListener.onMessage(session, createTriggerLspResync());
final TestingSessionListener sessionListenerAfterReconnect = getListener(factory);
checkResyncSession(Optional.of(lspQuantity), 2, 6, null, numberOflspAndDBv, sessionListenerAfterReconnect);
channel.close().get();
}
Aggregations