Search in sources :

Example 1 with GlobalBuilder

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());
}
Also used : GlobalBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder) Test(org.junit.Test)

Example 2 with GlobalBuilder

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());
}
Also used : GlobalBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder) Test(org.junit.Test)

Example 3 with GlobalBuilder

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;
}
Also used : GlobalBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder) StateBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.StateBuilder) AfiSafiBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder) GlobalAfiSafiStateAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.GlobalAfiSafiStateAugmentationBuilder) AfiSafisBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.AfiSafisBuilder)

Aggregations

GlobalBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.GlobalBuilder)3 Test (org.junit.Test)2 AfiSafiBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder)1 AfiSafisBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.AfiSafisBuilder)1 StateBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base.StateBuilder)1 GlobalAfiSafiStateAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.GlobalAfiSafiStateAugmentationBuilder)1