Search in sources :

Example 6 with PCCTunnelManager

use of org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager in project bgpcep by opendaylight.

the class PCCTunnelManagerImplTest method testOnSessionDownAndDelegateBack.

@Test
public void testOnSessionDownAndDelegateBack() throws InterruptedException {
    final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, 10, TIMER, this.timerHandler);
    checkSessionUp(this.session1, tunnelManager);
    checkSessionUp(this.session2, tunnelManager);
    checkSessionDown(this.session1, tunnelManager);
    tunnelManager.onSessionUp(this.session1);
    Mockito.verify(this.session1, Mockito.times(4)).sendReport(Mockito.any(Pcrpt.class));
    Mockito.verify(this.session2, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
}
Also used : PCCTunnelManager(org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager) Pcrpt(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt) Test(org.junit.Test)

Example 7 with PCCTunnelManager

use of org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager in project bgpcep by opendaylight.

the class PCCTunnelManagerImplTest method testTakeDelegationUnknownLsp.

@Test
public void testTakeDelegationUnknownLsp() {
    final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER, this.timerHandler);
    tunnelManager.onSessionUp(this.session1);
    tunnelManager.onMessagePcInitiate(createRequestsDelegate(1), this.session1);
    Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
    assertEquals(PCEPErrors.UNKNOWN_PLSP_ID, this.errorsSession1.get(0));
}
Also used : PCCTunnelManager(org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager) Pcerr(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr) Test(org.junit.Test)

Example 8 with PCCTunnelManager

use of org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager in project bgpcep by opendaylight.

the class PCCTunnelManagerImplTest method testTakeDelegationNotPceInitiatedLsp.

@Test
public void testTakeDelegationNotPceInitiatedLsp() {
    final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER, this.timerHandler);
    tunnelManager.onSessionUp(this.session1);
    tunnelManager.onMessagePcInitiate(createRequestsDelegate(1), this.session1);
    Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
    assertEquals(PCEPErrors.LSP_NOT_PCE_INITIATED, this.errorsSession1.get(0));
}
Also used : PCCTunnelManager(org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager) Pcerr(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr) Test(org.junit.Test)

Example 9 with PCCTunnelManager

use of org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager in project bgpcep by opendaylight.

the class PCCTunnelManagerImplTest method testRemoveTunnelUnknownLsp.

@Test
public void testRemoveTunnelUnknownLsp() {
    final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER, this.timerHandler);
    tunnelManager.onSessionUp(this.session1);
    tunnelManager.onMessagePcInitiate(createRequestsRemove(1), this.session1);
    Mockito.verify(this.session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
    assertEquals(PCEPErrors.UNKNOWN_PLSP_ID, this.errorsSession1.get(0));
}
Also used : PCCTunnelManager(org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager) Pcerr(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr) Test(org.junit.Test)

Example 10 with PCCTunnelManager

use of org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager in project bgpcep by opendaylight.

the class PCCTunnelManagerImplTest method testOnSessionUp.

@Test
public void testOnSessionUp() {
    final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER, this.timerHandler);
    checkSessionUp(this.session1, tunnelManager);
    checkSessionUp(this.session2, tunnelManager);
}
Also used : PCCTunnelManager(org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager) Test(org.junit.Test)

Aggregations

PCCTunnelManager (org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager)20 Test (org.junit.Test)18 Pcerr (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcerr)9 Pcrpt (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt)8 PCCDispatcherImpl (org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl)2 HashedWheelTimer (io.netty.util.HashedWheelTimer)1 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 PCEPSessionImpl (org.opendaylight.protocol.pcep.impl.PCEPSessionImpl)1 PCCSessionListener (org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener)1