use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method binaryAddressFromIpAddress_Ipv4Binary.
/**
* Tests {@link LispAddressUtil#binaryAddressFromIpAddress(IpAddress)} and {@link
* LispAddressUtil#binaryAddressTypeFromIpAddress(IpAddress)}
* methods with Ipv4Binary address.
*/
@Test
public void binaryAddressFromIpAddress_Ipv4Binary() {
final IpAddress ipv4Address = new IpAddress(new Ipv4Address(IPV4_ADDRESS_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.binaryAddressTypeFromIpAddress(ipv4Address);
assertEquals(Ipv4BinaryAfi.class, addressClass);
final Address address = LispAddressUtil.binaryAddressFromIpAddress(ipv4Address);
assertEquals(IPV4_BINARY, address);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method addressFromServicePathTest_withNull.
/**
* Test {@link LispAddressUtil#addressFromServicePath(ServicePath)} method with null value.
*/
@Test
public void addressFromServicePathTest_withNull() {
final Address testedAddress = LispAddressUtil.addressFromServicePath(null);
assertNull(testedAddress);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method addressFromAsNumberTest_withNull.
/**
* Test {@link LispAddressUtil#addressFromAsNumber(AsNumber)} method with null instead of value.
*/
@Test
public void addressFromAsNumberTest_withNull() {
final Address testedAddress = LispAddressUtil.addressFromAsNumber(null);
assertNull(testedAddress);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asIpPrefix_other.
/**
* Tests {@link LispAddressUtil#asIpPrefix(String, int)} with incorrect ip address and correct mask.
*/
@Test
public void asIpPrefix_other() {
final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(INCORRECT_IP_ADDRESS_TEST, MASK_OK_TEST);
assertNull(ipPrefix);
}
Aggregations