X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=mappingservice%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Flispflowmapping%2Fimplementation%2Fserializer%2Faddress%2FLispSegmentLCAFAddressTest.java;fp=mappingservice%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Flispflowmapping%2Fimplementation%2Fserializer%2Faddress%2FLispSegmentLCAFAddressTest.java;h=ab96d97199e11462cfd6a18fb40e015c8d9224dc;hb=b24e66c347b505eaaaacc1671edf7770c607a670;hp=e54150438af9f04a9c05a7fe001d4847ef5a58cc;hpb=455c1b48e65f2c4f59269de40d35755fd3a9f481;p=lispflowmapping.git diff --git a/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/address/LispSegmentLCAFAddressTest.java b/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/address/LispSegmentLCAFAddressTest.java index e54150438..ab96d9719 100644 --- a/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/address/LispSegmentLCAFAddressTest.java +++ b/mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/serializer/address/LispSegmentLCAFAddressTest.java @@ -37,7 +37,7 @@ public class LispSegmentLCAFAddressTest extends BaseTestCase { LcafSegmentAddress segAddress = (LcafSegmentAddress) address; assertEquals(LispAFIConvertor.asPrimitiveIPAfiAddress("17.34.51.68"), segAddress.getAddress().getPrimitiveAddress()); - assertEquals(0xAABBCCDD, segAddress.getInstanceId().intValue()); + assertEquals(0x00BBCCDD, segAddress.getInstanceId().intValue()); // only first 24bit are relevant. assertEquals(LispCanonicalAddressFormatEnum.SEGMENT.getLispCode(), segAddress.getLcafType().byteValue()); } @@ -72,14 +72,14 @@ public class LispSegmentLCAFAddressTest extends BaseTestCase { @Test public void serialize__Simple() throws Exception { LcafSegmentBuilder addressBuilder = new LcafSegmentBuilder(); - addressBuilder.setInstanceId((long) 0x01020304); + addressBuilder.setInstanceId((long) 0x00020304); addressBuilder.setAfi(AddressFamilyNumberEnum.LCAF.getIanaCode()).setLcafType((short) LispCanonicalAddressFormatEnum.SEGMENT.getLispCode()); addressBuilder.setAddress(new AddressBuilder().setPrimitiveAddress(LispAFIConvertor.asPrimitiveIPAfiAddress("17.34.51.68")).build()); ByteBuffer buf = ByteBuffer.allocate(LispAddressSerializer.getInstance().getAddressSize(addressBuilder.build())); LispAddressSerializer.getInstance().serialize(buf, addressBuilder.build()); ByteBuffer expectedBuf = hexToByteBuffer("40 03 00 00 " + // "02 00 00 0A " + // - "01 02 03 04 " + // instance ID + "00 02 03 04 " + // instance ID "00 01 11 22 33 44"); ArrayAssert.assertEquals(expectedBuf.array(), buf.array()); }