use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method addressFromIpPrefix_null.
/**
* Tests {@link LispAddressUtil#addressFromIpPrefix(IpPrefix)} and {@link LispAddressUtil#addressTypeFromIpPrefix
* (IpPrefix)}
* methods with null value instead off address.
*/
@Test
public void addressFromIpPrefix_null() {
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(null);
assertNull(addressClass);
final Address address = LispAddressUtil.addressFromIpPrefix(null);
assertNull(address);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEid_ipPrefix.
/**
* Test
* - {@link LispAddressUtil#toEid(IpPrefix, InstanceIdType)}
* method.
*/
@Test
public void toEid_ipPrefix() {
final Eid eidFromIpPrefix = LispAddressUtil.toEid(IP_ADDRESS_PREFIX_WITH_IPV4_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv4Prefix(eidFromIpPrefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method addressFromIpPrefix_ipv6.
/**
* Tests {@link LispAddressUtil#addressFromIpPrefix(IpPrefix)} and {@link
* LispAddressUtil#addressTypeFromIpPrefix(IpPrefix)}
* methods with ipv6 address.
*/
@Test
public void addressFromIpPrefix_ipv6() {
IpPrefix ipv6Address = new IpPrefix(new Ipv6Prefix(IPV6_ADDRESS_PREFIX_VALUE_TEST));
final Class<? extends LispAddressFamily> addressClass = LispAddressUtil.addressTypeFromIpPrefix(ipv6Address);
assertEquals(Ipv6PrefixAfi.class, addressClass);
final Address address = LispAddressUtil.addressFromIpPrefix(ipv6Address);
assertTrue(address instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix);
assertEquals(IPV6_ADDRESS_PREFIX_VALUE_TEST, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) address).getIpv6Prefix().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asIpPrefix_ipv4.
/**
* Tests {@link LispAddressUtil#asIpPrefix(String, int)} with ipv4 address and correct mask.
*/
@Test
public void asIpPrefix_ipv4() {
final IpPrefix ipPrefix = LispAddressUtil.asIpPrefix(IPV4_ADDRESS_VALUE_TEST, MASK_OK_TEST);
assertNotNull(ipPrefix);
final Ipv4Prefix ipv4Prefix = ipPrefix.getIpv4Prefix();
assertNotNull(ipv4Prefix);
assertEquals(IPV4_ADDRESS_PREFIX_TEST, ipv4Prefix);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEidNoVni.
/**
* Tests {@link LispAddressUtil#toEidNoVni(IpPrefix)} method.
*/
@Test
public void toEidNoVni() {
final Eid eid = LispAddressUtil.toEidNoVni(IP_ADDRESS_PREFIX_WITH_IPV4_TEST);
verifyEidContainsIpPrefix(eid, MASK_OK_TEST);
}
Aggregations