use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method addressFromServicePathTest_withServicePath.
/**
* Test {@link LispAddressUtil#addressFromServicePath(ServicePath)} method with concrete servicePath.
*/
@Test
public void addressFromServicePathTest_withServicePath() {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder servicePathBuilder = new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder();
servicePathBuilder.setServiceIndex(SERVICE_INDEX_TEST);
servicePathBuilder.setServicePathId(new ServicePathIdType(DUMMY_SERVICE_PATH_ID_TYPE));
ServicePath expectedAddress = servicePathBuilder.build();
final Address testedAddress = LispAddressUtil.addressFromServicePath(expectedAddress);
assertTrue(testedAddress instanceof org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath);
assertEquals(expectedAddress, ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath) testedAddress).getServicePath());
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder in project lispflowmapping by opendaylight.
the class ServicePathSerializer method deserializeData.
private Address deserializeData(ByteBuffer buffer) {
ServicePathBuilder spb = new ServicePathBuilder();
byte[] spi = new byte[3];
buffer.get(spi);
spb.setServicePathId(new ServicePathIdType((long) ByteUtil.getPartialInt(spi)));
spb.setServiceIndex((short) ByteUtil.getUnsignedByte(buffer));
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePathBuilder().setServicePath(spb.build()).build();
}
Aggregations