use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asSrcDstEid_addressesAsSrcDstKey.
/**
* Tests {@link LispAddressUtil#asSrcDstEid(SourceDestKey, InstanceIdType)} method.
*/
@Test
public void asSrcDstEid_addressesAsSrcDstKey() {
final SourceDestKey expectedSourceDestKey = new SourceDestKeyBuilder().setSource(SIMPLE_ADDRESS_IPV4_PREFIX_TEST).setDest(SIMPLE_ADDRESS_IPV6_PREFIX_TEST).build();
final Eid srcDstEid = LispAddressUtil.asSrcDstEid(expectedSourceDestKey, INSTANCE_ID_TYPE_TEST);
assertNotNull(srcDstEid);
assertEquals(SourceDestKeyLcaf.class, srcDstEid.getAddressType());
final SourceDestKey testedSourceDestKey = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) srcDstEid.getAddress()).getSourceDestKey();
assertNotNull(testedSourceDestKey);
assertEquals(SIMPLE_ADDRESS_IPV4_PREFIX_TEST, testedSourceDestKey.getSource());
assertEquals(SIMPLE_ADDRESS_IPV6_PREFIX_TEST, testedSourceDestKey.getDest());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asServicePathEid.
/**
* Tests {@link LispAddressUtil#asServicePathEid(long, long, short)} method.
*/
@Test
public void asServicePathEid() {
final Eid eid = LispAddressUtil.asServicePathEid(INSTANCE_ID_TYPE_VALUE_TEST, SERVICE_PATH_ID_TEST, SERVICE_INDEX_TEST);
assertNotNull(eid);
assertEquals(ServicePathLcaf.class, eid.getAddressType());
assertEquals(INSTANCE_ID_TYPE_TEST, eid.getVirtualNetworkId());
ServicePath servicePath = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath) eid.getAddress()).getServicePath();
assertNotNull(servicePath);
assertEquals(SERVICE_INDEX_TEST, servicePath.getServiceIndex());
assertEquals(SERVICE_PATH_ID_TEST, servicePath.getServicePathId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method toEid_mac.
/**
* Test
* - {@link LispAddressUtil#toEid(MacAddress, InstanceIdType)}
* - {@link LispAddressUtil#asMacEid(String)}
* - {@link LispAddressUtil#asMacEid(String, long)}
* methods.
*/
@Test
public void toEid_mac() {
Eid eidFromMac = LispAddressUtil.toEid(MAC_ADDRESS_TEST, INSTANCE_ID_TYPE_TEST);
verifyToEidWithMacAddress(eidFromMac, true);
eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST);
verifyToEidWithMacAddress(eidFromMac, false);
eidFromMac = LispAddressUtil.asMacEid(MAC_ADDRESS_VALUE_TEST, INSTANCE_ID_TYPE_VALUE_TEST);
verifyToEidWithMacAddress(eidFromMac, true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asKeyValueAddressEid.
/**
* Tests {@link LispAddressUtil#asKeyValueAddressEid(SimpleAddress, SimpleAddress)} method.
*/
@Test
public void asKeyValueAddressEid() {
final Eid eid = LispAddressUtil.asKeyValueAddressEid(SIMPLE_ADDRESS_IPV4_TEST, SIMPLE_ADDRESS_MAC_TEST);
verifyKeyValueAddress(eid, SIMPLE_ADDRESS_IPV4_TEST);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method asBinaryEidTest_ipv6Prefix.
/**
* Tests {@link LispAddressUtil#asBinaryEid(SimpleAddress, InstanceIdType)} method with ipv6Prefix.
*/
@Test
public void asBinaryEidTest_ipv6Prefix() {
final Eid result = LispAddressUtil.asBinaryEid(SIMPLE_ADDRESS_IPV6_PREFIX_TEST, INSTANCE_ID_TYPE_TEST);
assertEquals(IPV6_ADDRESS_PREFIX_BINARY_EID_1, result);
}
Aggregations