use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.peer.group.PeerGroupBuilder 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.peer.group.PeerGroupBuilder in project bgpcep by opendaylight.
the class PeerGroupStateCliUtilsTest method testEmptyPeerGroupStateCli.
@Test
public void testEmptyPeerGroupStateCli() throws IOException {
final PeerGroupBuilder peerGroup = new PeerGroupBuilder().setPeerGroupName(TEST_GROUP);
PeerGroupStateCliUtils.displayPeerOperationalState(Collections.singletonList(peerGroup.build()), this.stream);
final String expected = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("empty-peer-group.txt"), UTF8);
assertEquals(expected, this.output.toString());
}
Aggregations