use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testMapRegisterOverwritesSameSubkey.
public void testMapRegisterOverwritesSameSubkey() throws SocketTimeoutException {
cleanUP();
Eid eid = LispAddressUtil.asIpv4PrefixBinaryEid("1.2.3.4/32");
SimpleAddress rloc1Value = new SimpleAddress(new IpAddress(new Ipv4Address("4.3.2.1")));
Rloc rloc1 = LispAddressUtil.asKeyValueAddress("subkey1", rloc1Value);
SimpleAddress rloc2Value = new SimpleAddress(new IpAddress(new Ipv4Address("4.3.2.2")));
Rloc rloc2 = LispAddressUtil.asKeyValueAddress("subkey2", rloc2Value);
MapReply mapReply = sendMapRegisterTwiceWithDiffrentValues(eid, rloc1, rloc2);
assertEquals(1, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().size());
assertEquals(rloc2, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().get(0).getRloc());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress in project lispflowmapping by opendaylight.
the class LispSimpleAddressStringifierTest method getStringTest_asIpv6Prefix.
/**
* Tests {@link LispSimpleAddressStringifier#getString} with Ipv6Prefix.
*/
@Test
public void getStringTest_asIpv6Prefix() {
SimpleAddress simpleAddress = new SimpleAddress(IPV6_PREFIX);
String result = LispSimpleAddressStringifier.getString(simpleAddress);
assertEquals(IPV6_PREFIX.getIpv6Prefix().getValue(), result);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress in project lispflowmapping by opendaylight.
the class LispSimpleAddressStringifierTest method getStringTest_asAsNumber.
/**
* Tests {@link LispSimpleAddressStringifier#getString} with AsNumber.
*/
@Test
public void getStringTest_asAsNumber() {
SimpleAddress simpleAddress = new SimpleAddress(AS_NUMBER);
String result = LispSimpleAddressStringifier.getString(simpleAddress);
assertEquals("AS" + AS_NUMBER.getValue(), result);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress in project lispflowmapping by opendaylight.
the class AfiListSerializerTest method deserialize__Simple.
@Test
public void deserialize__Simple() throws Exception {
Rloc address = LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer(//
"40 03 00 00 " + //
"01 00 00 18 " + // IPv4
"00 01 AA BB CC DD " + // IPv6
"00 02 11 22 33 44 11 22 33 44 11 22 33 44 11 22 33 44"));
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
assertEquals(2, addressList.size());
assertEquals("170.187.204.221", String.valueOf(addressList.get(0).getValue()));
assertEquals("1122:3344:1122:3344:1122:3344:1122:3344", String.valueOf(addressList.get(1).getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress in project lispflowmapping by opendaylight.
the class AfiListSerializerTest method deserialize__NoAddresses.
@Test
public void deserialize__NoAddresses() throws Exception {
Rloc address = LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer(//
"40 03 00 00 " + "01 00 00 00 "));
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
assertEquals(0, addressList.size());
}
Aggregations