when(bgpSessionState.getMessagesStats()).thenReturn(msgStats);
when(speakerPref.getAddPathCapability()).thenReturn(true);
when(peerPref.getAddPathCapability()).thenReturn(true);
- when(errorReceived.getCount()).thenReturn(new ZeroBasedCounter32(5l));
+ when(errorReceived.getCount()).thenReturn(new ZeroBasedCounter32(5L));
when(errorMsgs.getErrorReceived()).thenReturn(newlist);
when(msgStats.getErrorMsgs()).thenReturn(errorMsgs);
@Test
public void testWritePathIdZero() {
- PathIdUtil.writePathId(new PathId(0l), this.buffer);
+ PathIdUtil.writePathId(new PathId(0L), this.buffer);
Assert.assertEquals(0, this.buffer.readableBytes());
}
@Test
public void testWritePathId() {
- PathIdUtil.writePathId(new PathId(10l), this.buffer);
+ PathIdUtil.writePathId(new PathId(10L), this.buffer);
Assert.assertEquals(Integer.BYTES, this.buffer.readableBytes());
}
doReturn(mockedChain).when(this.mockedRIB).createPeerChain(any());
doNothing().when(mockedChain).close();
doReturn(YangInstanceIdentifier.of(BgpRib.QNAME)).when(this.mockedRIB).getYangRibId();
- doReturn(new AsNumber(123456l)).when(this.mockedRIB).getLocalAs();
+ doReturn(new AsNumber(123456L)).when(this.mockedRIB).getLocalAs();
doReturn(BGP_ID).when(this.mockedRIB).getBgpIdentifier();
final BGPRenderStats mockedRenderStats = mock(BGPRenderStats.class);
doReturn(new LongAdder()).when(mockedRenderStats).getConfiguredPeerCounter();
this.listener = (Stateful07TopologySessionListener) getSessionListener();
//session up - expect sync (LSP-DBs do not match)
- final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2l)).build();
+ final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2L)).build();
this.session = getPCEPSession(getOpen(localDbVersion), getOpen(null));
this.listener.onSessionUp(session);
return MsgBuilderUtil.createPcRtpMessage(createLsp(0, false, Optional.of(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder().addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync
- .optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3l)).build()).build()).build()), true, false), Optional.<Srp>absent(),
+ .optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3L)).build()).build()).build()), true, false), Optional.<Srp>absent(),
createPath(Collections.<Subobject>emptyList()));
}
}
.child(Topology.class, new TopologyKey(new TopologyId("topology")));
private static final NodeId NODE_ID = new NodeId("node");
private static final LspDbVersion LSP_DB_VERSION = new LspDbVersionBuilder().setLspDbVersionValue(
- BigInteger.valueOf(1l)).build();
+ BigInteger.valueOf(1L)).build();
@Mock
private DataBroker dataBroker;
@Test
public void testTriggeredResynchronization() throws InterruptedException, ExecutionException {
//session up - sync skipped (LSP-DBs match)
- final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build();
+ final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build();
this.session = getPCEPSession(getOpen(lspDbVersion), getOpen(lspDbVersion));
this.listener.onSessionUp(session);
@Test
public void testTriggeredResynchronizationLsp() throws InterruptedException, ExecutionException {
//session up - sync skipped (LSP-DBs match)
- final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build();
+ final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build();
this.session = getPCEPSession(getOpen(lspDbVersion), getOpen(lspDbVersion));
this.listener.onSessionUp(session);
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder().addAugmentation(
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder()
- .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3l)).build()).build()).build()), true, false),
+ .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3L)).build()).build()).build()), true, false),
Optional.of(srpBuilder.build()), createPath(Collections.<Subobject>emptyList()));
}
private Pcrpt getPcrt() {
- return MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1l)).setTlvs(
+ return MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1L)).setTlvs(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.
- TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1l)).build()).setSymbolicPathName(
+ TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1L)).build()).setSymbolicPathName(
new SymbolicPathNameBuilder().setPathName(new SymbolicPathName("test".getBytes())).build())
.addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder()
- .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build()).build()).build())
+ .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build()).build()).build())
.setPlspId(new PlspId(1L)).setSync(true).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.<Srp>absent(),
createPath(Collections.<Subobject>emptyList()));
}
this.listener = (Stateful07TopologySessionListener) getSessionListener();
//session up - expect triggered sync (LSP-DBs do not match)
- final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build();
- final LspDbVersion localDbVersion2 = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2l)).build();
+ final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build();
+ final LspDbVersion localDbVersion2 = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2L)).build();
this.session = getPCEPSession(getOpen(localDbVersion, Boolean.FALSE), getOpen(localDbVersion2, Boolean.FALSE));
this.listener.onSessionUp(session);
.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class, new org.opendaylight
.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714
.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger
- .valueOf(2l)).build()).build()).build()), true, false), Optional.<Srp>absent(),
+ .valueOf(2L)).build()).build()).build()), true, false), Optional.<Srp>absent(),
createPath(Collections.<Subobject>emptyList()));
}
private Pcrpt getPcrpt() {
- return MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1l)).setTlvs(
+ return MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1L)).setTlvs(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp
- .object.lsp.TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1l)).build
+ .object.lsp.TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1L)).build
()).setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName("test"
.getBytes())).build()).addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class, new org.opendaylight.yang.gen.v1
.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder()
- .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3l)).build())
+ .setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(3L)).build())
.build()).build()).setPlspId(new PlspId(1L)).setSync(true).setRemove(false).setOperational
(OperationalStatus.Active).build(), Optional.<Srp>absent(), createPath(Collections.<Subobject>emptyList()));
}
final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setTlvs(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder()
.addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build()).build()).build()).setPlspId(new PlspId(1L)).setSync(false).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.of(MsgBuilderUtil.createSrp(1l)), null);
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build()).build()).build()).setPlspId(new PlspId(1L)).setSync(false).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.of(MsgBuilderUtil.createSrp(1L)), null);
this.listener.onMessage(session, pcRpt);
//check topology
final Topology topo1 = getTopology().get();
final LspDbVersion lspDb1 = topo1.getNode().get(0).getAugmentation(Node1.class).getPathComputationClient().getAugmentation(PathComputationClient1.class).getLspDbVersion();
- Assert.assertEquals(1l, lspDb1.getLspDbVersionValue().longValue());
+ Assert.assertEquals(1L, lspDb1.getLspDbVersionValue().longValue());
//drop session
this.listener.onSessionDown(session, new IllegalStateException());
//check topology - node is persisted
@Test
public void testStateSynchronizationSkipped() throws InterruptedException, ExecutionException {
//session up - sync skipped (LSP-DBs match)
- final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build();
+ final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build();
this.session = getPCEPSession(getOpen(lspDbVersion), getOpen(lspDbVersion));
this.listener.onSessionUp(session);
//check node - synchronized
this.session = getPCEPSession(getOpen(null), getOpen(null));
this.listener.onSessionUp(session);
//report LSP + LSP-DB version number
- final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1l)).setTlvs(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1l)).build()).setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName("test".getBytes())).build())
+ final Pcrpt pcRpt = MsgBuilderUtil.createPcRtpMessage(new LspBuilder().setPlspId(new PlspId(1L)).setTlvs(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder().setLspId(new LspId(1L)).build()).setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName("test".getBytes())).build())
.addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1l)).build()).build()).build()).setPlspId(new PlspId(1L)).setSync(true).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.<Srp>absent(), createPath(Collections.<Subobject> emptyList()));
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(1L)).build()).build()).build()).setPlspId(new PlspId(1L)).setSync(true).setRemove(false).setOperational(OperationalStatus.Active).build(), Optional.<Srp>absent(), createPath(Collections.<Subobject> emptyList()));
this.listener.onMessage(session, pcRpt);
final Topology topo = getTopology().get();
final PathComputationClient pcc = topo.getNode().get(0).getAugmentation(Node1.class).getPathComputationClient();
this.listener = (Stateful07TopologySessionListener) getSessionListener();
//session up - expect sync (LSP-DBs do not match)
- final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2l)).build();
+ final LspDbVersion localDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2L)).build();
this.session = getPCEPSession(getOpen(localDbVersion), getOpen(null));
this.listener.onSessionUp(session);
//sync rpt + LSP-DB
final Pcrpt syncMsg = MsgBuilderUtil.createPcRtpMessage(createLsp(0, false, Optional.of(
new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder().addAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1.class,
- new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2l)).build()).build()).build()), true, false), Optional.<Srp>absent(),
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev150714.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().setLspDbVersionValue(BigInteger.valueOf(2L)).build()).build()).build()), true, false), Optional.<Srp>absent(),
createPath(Collections.<Subobject> emptyList()));
this.listener.onMessage(session, syncMsg);
final Topology topo3 = getTopology().get();
@Test
public void testDoesLspDbMatchPositive() {
- final Tlvs tlvs = createTlvs(1l, false, false);
+ final Tlvs tlvs = createTlvs(1L, false, false);
Mockito.doReturn(tlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(tlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testDoesLspDbMatchNegative() {
- final Tlvs localTlvs = createTlvs(1l, false, false);
- final Tlvs remoteTlvs = createTlvs(2l, false, false);
+ final Tlvs localTlvs = createTlvs(1L, false, false);
+ final Tlvs remoteTlvs = createTlvs(2L, false, false);
Mockito.doReturn(localTlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(remoteTlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testIsSyncAvoidanceEnabledPositive() {
- final Tlvs tlvs = createTlvs(1l, true, false);
+ final Tlvs tlvs = createTlvs(1L, true, false);
Mockito.doReturn(tlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(tlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testIsSyncAvoidanceEnabledNegative() {
- final Tlvs localTlvs = createTlvs(1l, true, false);
- final Tlvs remoteTlvs = createTlvs(2l, false, false);
+ final Tlvs localTlvs = createTlvs(1L, true, false);
+ final Tlvs remoteTlvs = createTlvs(2L, false, false);
Mockito.doReturn(localTlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(remoteTlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testIsDeltaSyncEnabledPositive() {
- final Tlvs tlvs = createTlvs(1l, true, true);
+ final Tlvs tlvs = createTlvs(1L, true, true);
Mockito.doReturn(tlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(tlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testIsDeltaSyncEnabledNegative() {
- final Tlvs localTlvs = createTlvs(1l, true, true);
- final Tlvs remoteTlvs = createTlvs(2l, false, false);
+ final Tlvs localTlvs = createTlvs(1L, true, true);
+ final Tlvs remoteTlvs = createTlvs(2L, false, false);
Mockito.doReturn(localTlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(remoteTlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test
public void testIsDbVersionPresentPositive() {
final Tlvs localTlvs = createTlvs(null, false, false);
- final Tlvs remoteTlvs = createTlvs(2l, false, false);
+ final Tlvs remoteTlvs = createTlvs(2L, false, false);
Mockito.doReturn(localTlvs).when(pcepSession).localSessionCharacteristics();
Mockito.doReturn(remoteTlvs).when(pcepSession).getRemoteTlvs();
final SyncOptimization syncOpt = new SyncOptimization(pcepSession);
@Test(timeout = 30 * 1000)
public void testTimeoutWhileScheduledTransaction() throws Exception {
- final BigInteger deadlineOffset = BigInteger.valueOf(1000l * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
+ final BigInteger deadlineOffset = BigInteger.valueOf(1000L * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
final Nanotime current = NanotimeUtil.currentTime();
final Nanotime deadlineNano = new Nanotime(current.getValue().add(deadlineOffset));
@Test(timeout = 30 * 1000)
public void testTimeoutWhileSuccessfulTransaction() throws Exception {
- final BigInteger deadlineOffset = BigInteger.valueOf(1000l * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
+ final BigInteger deadlineOffset = BigInteger.valueOf(1000L * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
final Nanotime current = NanotimeUtil.currentTime();
final Nanotime deadlineNano = new Nanotime(current.getValue().add(deadlineOffset));
@Test(timeout = 30 * 1000)
public void testTimeoutWhileExecutingWithDependenciesTransaction() throws Exception {
- final BigInteger deadlineOffset = BigInteger.valueOf(1000l * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
+ final BigInteger deadlineOffset = BigInteger.valueOf(1000L * 1000 * 1000 * INSTRUCTION_DEADLINE_OFFSET_IN_SECONDS /* seconds */);
final Nanotime current = NanotimeUtil.currentTime();
final Nanotime deadlineNano = new Nanotime(current.getValue().add(deadlineOffset));