use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType 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.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEid_ipv6Prefix.
/**
* Test
* - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
* - {@link LispAddressUtil#asIpv6PrefixEid(String)}
* - {@link LispAddressUtil#asIpv6PrefixEid(Eid, Inet6Address, short)}
* - {@link LispAddressUtil#asIpv6PrefixEid(Ipv6Address, InstanceIdType)}
* methods.
*/
@Test
public void toEid_ipv6Prefix() throws UnknownHostException {
final Inet6Address inet6Address = (Inet6Address) Inet6Address.getByName(IPV6_ADDRESS_VALUE_TEST);
Eid eidFromIpv6Prefix = LispAddressUtil.toEid(IPV6_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_TEST, Ipv6PrefixAfi.class);
eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_PREFIX_VALUE_TEST);
verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, false, MASK_OK_TEST, Ipv6PrefixAfi.class);
eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_PREFIX_BINARY_EID_1, inet6Address, MASK_OK_DEFAULT_IPV6_TEST);
verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_DEFAULT_IPV6_TEST, Ipv6PrefixAfi.class);
eidFromIpv6Prefix = LispAddressUtil.asIpv6PrefixEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv6Prefix(eidFromIpv6Prefix, true, MASK_OK_DEFAULT_IPV6_TEST, Ipv6PrefixAfi.class);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asBinaryEidTest_ipv4.
/**
* Tests {@link LispAddressUtil#asBinaryEid(SimpleAddress, InstanceIdType)} method with ipv4.
*/
@Test
public void asBinaryEidTest_ipv4() {
final Eid result = LispAddressUtil.asBinaryEid(SIMPLE_ADDRESS_IPV4_TEST, INSTANCE_ID_TYPE_TEST);
assertEquals(IPV4_ADDRESS_BINARY_EID, result);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEid_ipv4Prefix.
/**
* Test
* - {@link LispAddressUtil#toEid(Ipv4Prefix, InstanceIdType)}
* - {@link LispAddressUtil#asIpv4PrefixEid(String)}
* - {@link LispAddressUtil#asIpv4PrefixEid(Eid, Inet4Address, short)}
* - {@link LispAddressUtil#asIpv4PrefixEid(Ipv4Address, InstanceIdType)} }
* methods.
*/
@Test
public void toEid_ipv4Prefix() throws UnknownHostException {
final Inet4Address inet4Address = (Inet4Address) Inet4Address.getByName(IPV4_ADDRESS_VALUE_TEST);
Eid eidFromIpv4Prefix = LispAddressUtil.toEid(IPV4_ADDRESS_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, true, MASK_OK_TEST, Ipv4PrefixAfi.class);
eidFromIpv4Prefix = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_PREFIX_VALUE_TEST);
verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, false, MASK_OK_TEST, Ipv4PrefixAfi.class);
eidFromIpv4Prefix = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_PREFIX_BINARY_EID_1, inet4Address, MASK_OK_DEFAULT_IPV4_TEST);
verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, true, MASK_OK_DEFAULT_IPV4_TEST, Ipv4PrefixAfi.class);
eidFromIpv4Prefix = LispAddressUtil.asIpv4PrefixEid(IPV4_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv4Prefix(eidFromIpv4Prefix, true, MASK_OK_DEFAULT_IPV4_TEST, Ipv4PrefixAfi.class);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEid_ipv6.
/**
* Test
* - {@link LispAddressUtil#toEid(Ipv6Address, InstanceIdType)}
* - {@link LispAddressUtil#toEid(Ipv6AddressBinary, InstanceIdType)}
* - {@link LispAddressUtil#asIpv6Eid(String)}
* - {@link LispAddressUtil#asIpv6Eid(String, long)}
* methods.
*/
@Test
public void toEid_ipv6() {
Eid eidFromIpv6 = LispAddressUtil.toEid(IPV6_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv6(eidFromIpv6, true);
eidFromIpv6 = LispAddressUtil.toEid(IPV6_ADDRESS_BINARY_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithIpv6Binary(eidFromIpv6, true);
eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST);
verifyToEidWithIpv6Binary(eidFromIpv6, false);
eidFromIpv6 = LispAddressUtil.asIpv6Eid(IPV6_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
verifyToEidWithIpv6Binary(eidFromIpv6, true);
}
Aggregations