import org.opendaylight.protocol.bgp.parser.BGPError;
import org.opendaylight.protocol.bgp.parser.impl.message.update.LocalPreferenceAttributeParser;
import org.opendaylight.protocol.bgp.rib.spi.RibSupportUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.ipv4.routes.ipv4.routes.Ipv4Route;
private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> routes;
private BGPPeer classic;
- private final Ipv4Address neighborAddress = new Ipv4Address("127.0.0.1");
+ private final IpAddress neighborAddress = new IpAddress(new Ipv4Address("127.0.0.1"));
@Override
@Before
final Ipv4Prefix first = new Ipv4Prefix("127.0.0.2/32");
final Ipv4Prefix second = new Ipv4Prefix("127.0.0.1/32");
final Ipv4Prefix third = new Ipv4Prefix("127.0.0.3/32");
- this.peer = new ApplicationPeer(new ApplicationRibId(this.neighborAddress.getValue()), this.neighborAddress, getRib());
+ this.peer = new ApplicationPeer(new ApplicationRibId(this.neighborAddress.getIpv4Address().getValue()),
+ this.neighborAddress.getIpv4Address(), getRib());
this.peer.instantiateServiceInstance(null, null);
final YangInstanceIdentifier base = getRib().getYangRibId().node(LocRib.QNAME).node(Tables.QNAME).node(RibSupportUtils.toYangTablesKey(KEY));
this.peer.onDataTreeChanged(ipv4Input(base, ModificationType.WRITE, first, second, third));
@Test
public void testClassicPeer() throws Exception {
- this.classic = new BGPPeer(this.neighborAddress.getValue(), getRib(), PeerRole.Ibgp, null, Collections.emptySet(),
+ this.classic = new BGPPeer(this.neighborAddress, getRib(), PeerRole.Ibgp, null, Collections.emptySet(),
Collections.emptySet());
this.classic.instantiateServiceInstance();
this.mockSession();
- assertEquals(this.neighborAddress.getValue(), this.classic.getName());
+ assertEquals(this.neighborAddress.getIpv4Address().getValue(), this.classic.getName());
this.classic.onSessionUp(this.session);
assertEquals(1, this.classic.getBgpPeerState().getSessionEstablishedCount().getValue().intValue());
Assert.assertArrayEquals(new byte[]{1, 1, 1, 1}, this.classic.getRawIdentifier());
assertEquals(3, this.routes.size());
//create new peer so that it gets advertized routes from RIB
- final BGPPeer testingPeer = new BGPPeer(this.neighborAddress.getValue(), getRib(), PeerRole.Ibgp, null,
+ final BGPPeer testingPeer = new BGPPeer(this.neighborAddress, getRib(), PeerRole.Ibgp, null,
Collections.emptySet(), Collections.emptySet());
testingPeer.instantiateServiceInstance();
testingPeer.onSessionUp(this.session);