use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbors.NeighborBuilder in project bgpcep by opendaylight.
the class OpenConfigMappingUtilTest method testIsActive.
@Test
public void testIsActive() {
final TransportBuilder builder = new TransportBuilder();
assertTrue(OpenConfigMappingUtil.isActive(new NeighborBuilder().build(), null));
assertTrue(OpenConfigMappingUtil.isActive(new NeighborBuilder().setTransport(builder.build()).build(), null));
final Transport activeFalse = builder.setConfig(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.transport.ConfigBuilder().setPassiveMode(true).build()).build();
assertFalse(OpenConfigMappingUtil.isActive(new NeighborBuilder().setTransport(activeFalse).build(), null));
assertTrue(OpenConfigMappingUtil.isActive(new NeighborBuilder().build(), new PeerGroupBuilder().build()));
assertFalse(OpenConfigMappingUtil.isActive(new NeighborBuilder().build(), new PeerGroupBuilder().setTransport(activeFalse).build()));
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbors.NeighborBuilder in project bgpcep by opendaylight.
the class NeighborStateCliUtilsTest method createBasicNeighbor.
static Neighbor createBasicNeighbor() {
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder builder = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder();
builder.addAugmentation(NeighborAfiSafiStateAugmentation.class, new NeighborAfiSafiStateAugmentationBuilder().setActive(false).build());
final AfiSafi afiSafi = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).setState(builder.build()).build();
return new NeighborBuilder().setNeighborAddress(NEIGHBOR_IP_ADDRESS).setState(new StateBuilder().build()).setAfiSafis(new AfiSafisBuilder().setAfiSafi(Collections.singletonList(afiSafi)).build()).build();
}
Aggregations