use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.NeighborTimersStateAugmentation in project bgpcep by opendaylight.
the class NeighborStateCliUtils method printTimerState.
private static void printTimerState(final Timers timers, final ShellTable table) {
if (timers == null) {
return;
}
final NeighborTimersStateAugmentation state = timers.getState().augmentation(NeighborTimersStateAugmentation.class);
if (state == null) {
return;
}
addHeader(table, "Timer state");
table.addRow().addContent("Negotiated Hold Time", state.getNegotiatedHoldTime());
table.addRow().addContent("Uptime", state.getUptime().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.NeighborTimersStateAugmentation in project bgpcep by opendaylight.
the class NeighborUtilTest method testBuildTimerNormalValue.
@Test
public void testBuildTimerNormalValue() {
final BGPTimersState timerState = mock(BGPTimersState.class);
doReturn(90L).when(timerState).getNegotiatedHoldTime();
doReturn(5000L).when(timerState).getUpTime();
final NeighborTimersStateAugmentation timerStateAug = new NeighborTimersStateAugmentationBuilder().setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(Uint32.valueOf(500))).build();
final Timers expectedTimers = new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.timers.StateBuilder().addAugmentation(timerStateAug).build()).build();
assertEquals(expectedTimers, NeighborUtil.buildTimer(timerState));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.NeighborTimersStateAugmentation in project bgpcep by opendaylight.
the class NeighborUtilTest method testBuildTimerRollOverValue.
@Test
public void testBuildTimerRollOverValue() {
final BGPTimersState timerState = mock(BGPTimersState.class);
doReturn(90L).when(timerState).getNegotiatedHoldTime();
doReturn(42949673015L).when(timerState).getUpTime();
final NeighborTimersStateAugmentation timerStateAug = new NeighborTimersStateAugmentationBuilder().setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(Uint32.valueOf(5))).build();
final Timers expectedTimers = new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.timers.StateBuilder().addAugmentation(timerStateAug).build()).build();
assertEquals(expectedTimers, NeighborUtil.buildTimer(timerState));
}
Aggregations