use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.initiation.Tlvs in project bgpcep by opendaylight.
the class Stateful07TopologySessionListenerTest method testDelegatedLspsCountWithoutDelegation.
@Test
public void testDelegatedLspsCountWithoutDelegation() throws Exception {
this.listener.onSessionUp(this.session);
this.topologyRpcs.addLsp(createAddLspInput());
assertEquals(1, this.receivedMsgs.size());
assertTrue(this.receivedMsgs.get(0) instanceof Pcinitiate);
final Pcinitiate pcinitiate = (Pcinitiate) this.receivedMsgs.get(0);
final Requests req = pcinitiate.getPcinitiateMessage().getRequests().get(0);
final long srpId = req.getSrp().getOperationId().getValue();
final Tlvs tlvs = createLspTlvs(req.getLsp().getPlspId().getValue(), true, this.testAddress, this.testAddress, this.testAddress, Optional.absent());
// delegate set to false
final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder(req.getLsp()).setTlvs(tlvs).setPlspId(new PlspId(1L)).setSync(false).setRemove(false).setOperational(OperationalStatus.Active).setDelegate(false).build(), Optional.of(MsgBuilderUtil.createSrp(srpId)), MsgBuilderUtil.createPath(req.getEro().getSubobject()));
this.listener.onMessage(this.session, pcRpt);
checkEquals(() -> assertEquals(0, this.listener.listenerState.getDelegatedLspsCount().intValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.initiation.Tlvs in project bgpcep by opendaylight.
the class SyncOptimizationTest method testIsDeltaSyncEnabledPositive.
@Test
public void testIsDeltaSyncEnabledPositive() {
final Tlvs tlvs = createTlvs(1L, true, true);
Mockito.doReturn(tlvs).when(this.pcepSession).getLocalTlvs();
Mockito.doReturn(tlvs).when(this.pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(this.pcepSession);
assertTrue(syncOpt.isDeltaSyncEnabled());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.initiation.Tlvs in project bgpcep by opendaylight.
the class SyncOptimizationTest method testIsDeltaSyncEnabledNegative.
@Test
public void testIsDeltaSyncEnabledNegative() {
final Tlvs localTlvs = createTlvs(1L, true, true);
final Tlvs remoteTlvs = createTlvs(2L, false, false);
Mockito.doReturn(localTlvs).when(this.pcepSession).getLocalTlvs();
Mockito.doReturn(remoteTlvs).when(this.pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(this.pcepSession);
assertFalse(syncOpt.isDeltaSyncEnabled());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.initiation.Tlvs in project bgpcep by opendaylight.
the class SyncOptimizationTest method testDoesLspDbMatchPositive.
@Test
public void testDoesLspDbMatchPositive() {
final Tlvs tlvs = createTlvs(1L, false, false);
Mockito.doReturn(tlvs).when(this.pcepSession).getLocalTlvs();
Mockito.doReturn(tlvs).when(this.pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(this.pcepSession);
assertTrue(syncOpt.doesLspDbMatch());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.initiation.Tlvs in project bgpcep by opendaylight.
the class SyncOptimizationTest method testIsSyncAvoidanceEnabledPositive.
@Test
public void testIsSyncAvoidanceEnabledPositive() {
final Tlvs tlvs = createTlvs(1L, true, false);
Mockito.doReturn(tlvs).when(this.pcepSession).getLocalTlvs();
Mockito.doReturn(tlvs).when(this.pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(this.pcepSession);
assertTrue(syncOpt.isSyncAvoidanceEnabled());
}
Aggregations