use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary in project lispflowmapping by opendaylight.
the class MapRequestUtilTest method selectItrRlocTest_Ipv6Binary.
/**
* Tests {@link MapRequestUtil#selectItrRloc} method with Ipv6Binary.
*/
@Test
public void selectItrRlocTest_Ipv6Binary() {
final ItrRlocBuilder itrRloc = new ItrRlocBuilder().setRloc(new RlocBuilder().setAddress(IPV6_ADDRESS_BINARY).build());
final MapRequest request = new MapRequestBuilder().setItrRloc(Lists.newArrayList(itrRloc.build())).build();
// expected result
InetAddress expectedResult = InetAddresses.forString(IPV6_STRING);
// result
InetAddress result = MapRequestUtil.selectItrRloc(request);
assertEquals(expectedResult, result);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary in project lispflowmapping by opendaylight.
the class Ipv6SerializerTest method constructor__Buffer.
@Test
public void constructor__Buffer() throws Exception {
Rloc rloc = LispAddressUtil.asIpv6Rloc("0:0:0:0:0:0:0:1");
assertEquals(Ipv6BinaryAfi.class, rloc.getAddressType());
assertEquals(18, LispAddressSerializer.getInstance().getAddressSize(rloc));
assertArrayEquals(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, ((Ipv6Binary) rloc.getAddress()).getIpv6Binary().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary in project lispflowmapping by opendaylight.
the class Ipv6SerializerTest method constructor__Name.
@Test
public void constructor__Name() throws Exception {
Rloc rloc = LispAddressUtil.asIpv6Rloc("0:0:0:0:0:0:0:0");
assertEquals(Ipv6BinaryAfi.class, rloc.getAddressType());
assertEquals(18, LispAddressSerializer.getInstance().getAddressSize(rloc));
assertArrayEquals(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, ((Ipv6Binary) rloc.getAddress()).getIpv6Binary().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method binaryAddressFromIpAddress_Ipv6Binary.
/**
* Tests {@link LispAddressUtil#binaryAddressFromIpAddress(IpAddress)} and {@link
* LispAddressUtil#binaryAddressTypeFromIpAddress(IpAddress)}
* methods with Ipv6Binary address.
*/
@Test
public void binaryAddressFromIpAddress_Ipv6Binary() {
final IpAddress ipv6Address = new IpAddress(new Ipv6Address(IPV6_ADDRESS_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.binaryAddressTypeFromIpAddress(ipv6Address);
assertEquals(Ipv6BinaryAfi.class, addressClass);
final Address address = LispAddressUtil.binaryAddressFromIpAddress(ipv6Address);
assertEquals(IPV6_BINARY, address);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method ipAddressToByteArray_ipv6Binary.
/**
* Tests {@link LispAddressUtil#ipAddressToByteArray(Address)} method with ipv6Binary value.
*/
@Test
public void ipAddressToByteArray_ipv6Binary() {
final Ipv6Binary expectedIpv6 = new Ipv6BinaryBuilder().setIpv6Binary(IPV6_ADDRESS_BINARY_TEST).build();
final byte[] testedAddress = LispAddressUtil.ipAddressToByteArray(expectedIpv6);
assertArrayEquals(IPV6_ADDRESS_BYTES_A_TEST, testedAddress);
}
Aggregations