Search in sources :

Example 1 with PCCPeerProposal

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();
}
Also used : PCCPeerProposal(org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal) PCEPSession(org.opendaylight.protocol.pcep.PCEPSession) Channel(io.netty.channel.Channel) Test(org.junit.Test)

Example 2 with PCCPeerProposal

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();
}
Also used : PCCPeerProposal(org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal) PCEPSession(org.opendaylight.protocol.pcep.PCEPSession) Channel(io.netty.channel.Channel) BigInteger(java.math.BigInteger) Test(org.junit.Test)

Example 3 with PCCPeerProposal

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();
}
Also used : PCCPeerProposal(org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal) PCEPSession(org.opendaylight.protocol.pcep.PCEPSession) Channel(io.netty.channel.Channel) BigInteger(java.math.BigInteger) Test(org.junit.Test)

Example 4 with PCCPeerProposal

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();
}
Also used : PCCPeerProposal(org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal) PCEPSession(org.opendaylight.protocol.pcep.PCEPSession) Channel(io.netty.channel.Channel) BigInteger(java.math.BigInteger) Test(org.junit.Test)

Aggregations

Channel (io.netty.channel.Channel)4 Test (org.junit.Test)4 PCEPSession (org.opendaylight.protocol.pcep.PCEPSession)4 PCCPeerProposal (org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCPeerProposal)4 BigInteger (java.math.BigInteger)3