Search in sources :

Example 6 with Tlvs

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.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());
}
Also used : Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs) Test(org.junit.Test)

Example 7 with Tlvs

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.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());
}
Also used : Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs) Test(org.junit.Test)

Example 8 with Tlvs

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.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());
}
Also used : Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs) Test(org.junit.Test)

Example 9 with Tlvs

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.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());
}
Also used : Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs) Test(org.junit.Test)

Example 10 with Tlvs

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.Tlvs in project bgpcep by opendaylight.

the class SyncOptimizationTest method testIsDbVersionPresentNegative.

@Test
public void testIsDbVersionPresentNegative() {
    final Tlvs tlvs = createTlvs(null, true, false);
    Mockito.doReturn(tlvs).when(this.pcepSession).getLocalTlvs();
    Mockito.doReturn(tlvs).when(this.pcepSession).getRemoteTlvs();
    final SyncOptimization syncOpt = new SyncOptimization(this.pcepSession);
    assertFalse(syncOpt.isDbVersionPresent());
}
Also used : Tlvs(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)21 MsgBuilderUtil.createLspTlvs (org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLspTlvs)13 Tlvs (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.lsp.Tlvs)13 Pcrpt (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Pcrpt)11 LspBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object.LspBuilder)11 BgpParameters (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters)9 Tlvs (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.Tlvs)9 BgpParametersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParametersBuilder)8 OptionalCapabilities (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.OptionalCapabilities)8 OptionalCapabilitiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.OptionalCapabilitiesBuilder)8 CParametersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.optional.capabilities.CParametersBuilder)8 CParameters1Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.CParameters1Builder)8 OpenBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.OpenBuilder)7 As4BytesCapabilityBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.bgp.parameters.optional.capabilities.c.parameters.As4BytesCapabilityBuilder)7 MultiprotocolCapabilityBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.mp.capabilities.MultiprotocolCapabilityBuilder)7 Pcinitiate (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.Pcinitiate)7 Requests (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev171025.pcinitiate.message.pcinitiate.message.Requests)7 PlspId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.PlspId)7 ProtocolVersion (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.ProtocolVersion)6 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)5