use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder in project bgpcep by opendaylight.
the class GlobalStateCliUtilsTest method testEmptyGlobalStateCliUtil.
@Test
public void testEmptyGlobalStateCliUtil() throws IOException {
final GlobalBuilder builder = buildGlobal(false);
GlobalStateCliUtils.displayRibOperationalState(RIB_ID, builder.build(), this.stream);
final String expected = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("empty-global.txt"), UTF8);
assertEquals(expected, this.output.toString());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder in project bgpcep by opendaylight.
the class GlobalStateCliUtilsTest method testGlobalStateCliUtil.
@Test
public void testGlobalStateCliUtil() throws IOException {
final GlobalBuilder builder = buildGlobal(true);
GlobalStateCliUtils.displayRibOperationalState(RIB_ID, builder.build(), this.stream);
final String expected = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("global.txt"), UTF8);
assertEquals(expected, this.output.toString());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder in project bgpcep by opendaylight.
the class GlobalStateCliUtilsTest method buildGlobal.
static GlobalBuilder buildGlobal(final boolean withStateAug) {
final GlobalBuilder builder = new GlobalBuilder().setState(new StateBuilder().setAs(AsNumber.getDefaultInstance("100")).setTotalPaths(1L).setTotalPrefixes(2L).build());
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder stateBuilder = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder();
if (withStateAug) {
stateBuilder.addAugmentation(GlobalAfiSafiStateAugmentation.class, new GlobalAfiSafiStateAugmentationBuilder().setTotalPaths(3L).setTotalPrefixes(4L).build());
}
builder.setAfiSafis(new AfiSafisBuilder().setAfiSafi(Collections.singletonList(new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).setState(stateBuilder.build()).build())).build());
return builder;
}
Aggregations