Search in sources :

Example 31 with InstanceIdType

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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) Test(org.junit.Test)

Example 32 with InstanceIdType

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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) Inet6Address(java.net.Inet6Address) Test(org.junit.Test)

Example 33 with InstanceIdType

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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) Test(org.junit.Test)

Example 34 with InstanceIdType

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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) Inet4Address(java.net.Inet4Address) Test(org.junit.Test)

Example 35 with InstanceIdType

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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) Test(org.junit.Test)

Aggregations

Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)21 EidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)18 Test (org.junit.Test)17 InstanceIdType (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType)12 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)4 MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)4 MappingRecord (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)4 GotMapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)3 EidItemBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItemBuilder)3 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)3 MapRequestBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestnotification.MapRequestBuilder)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Ipv4PrefixBuilder (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4PrefixBuilder)2 Ipv4AddressBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.inet.binary.types.rev160303.Ipv4AddressBinary)2 Ipv4PrefixBinaryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinaryBuilder)2 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)2 Preconditions (com.google.common.base.Preconditions)1 Inet4Address (java.net.Inet4Address)1 Inet6Address (java.net.Inet6Address)1 InetAddress (java.net.InetAddress)1