* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.lispflowmapping.type.lisp;
+package org.opendaylight.lispflowmapping.southbound.serializer;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import junitx.framework.ArrayAssert;
import org.junit.Test;
-import org.opendaylight.lispflowmapping.type.lisp.address.LispIpv4Address;
import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
+import org.opendaylight.lispflowmapping.type.lisp.EidToLocatorRecord;
+import org.opendaylight.lispflowmapping.type.lisp.LocatorRecord;
+import org.opendaylight.lispflowmapping.type.lisp.MapRegister;
+import org.opendaylight.lispflowmapping.type.lisp.MapReplyAction;
+import org.opendaylight.lispflowmapping.type.lisp.address.LispIpv4Address;
-public class MapRegisterTest extends BaseTestCase {
+public class MapRegisterSerializationTest extends BaseTestCase {
@Test
public void deserialize__AllFields() throws Exception {
// Local RLOC: 192.168.136.10 (RLOC=0xC0A8880A), Reachable,
// Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
//
- MapRegister mr = MapRegister.deserialize(hexToByteBuffer("38 00 01 01 FF BB " //
+ MapRegister mr = MapRegisterSerializer.getInstance().deserialize(hexToByteBuffer("38 00 01 01 FF BB " //
+ "00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 c5 f2 " //
+ "b0 21 27 a8 21 41 04 f3 46 5a a5 68 89 ec 00 00 " //
+ "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " //
// Local RLOCs: 192.168.136.10 -- 192.168.136.11 -- 192.168.136.12 --
// 192.168.136.13
//
- MapRegister mr = MapRegister.deserialize(hexToByteBuffer("38 00 01 " //
+ MapRegister mr = MapRegisterSerializer.getInstance().deserialize(hexToByteBuffer("38 00 01 " //
+ "04 " // Record count
+ "FF BB 00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 " //
+ "c5 f2 b0 21 27 a8 21 41 04 f3 46 5a a5 68 89 ec " //
@Test
public void deserialize__Locators() throws Exception {
- MapRegister mr = MapRegister.deserialize(hexToByteBuffer("38 00 01 01 " //
+ MapRegister mr = MapRegisterSerializer.getInstance().deserialize(hexToByteBuffer("38 00 01 01 " //
+ "FF BB 00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 " //
+ "c5 f2 b0 21 27 a8 21 41 04 f3 46 5a a5 68 89 ec " //
+ "00 00 00 0a " //
// Local RLOCs: 192.168.136.10 -- 192.168.136.11 -- 192.168.136.12 --
// 192.168.136.13
//
- MapRegister mr = MapRegister.deserialize(hexToByteBuffer("38 00 01 " //
+ MapRegister mr = MapRegisterSerializer.getInstance().deserialize(hexToByteBuffer("38 00 01 " //
+ "04 " // Record count
+ "FF BB 00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 " //
+ "c5 f2 b0 21 27 a8 21 41 04 f3 46 5a a5 68 89 ec " //
@Test
public void deserialize__IllegalAction() throws Exception {
- MapRegister mr = MapRegister.deserialize(hexToByteBuffer("38 00 01 01 FF BB " //
+ MapRegister mr = MapRegisterSerializer.getInstance().deserialize(hexToByteBuffer("38 00 01 01 FF BB " //
+ "00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 c5 f2 " //
+ "b0 21 27 a8 21 41 04 f3 46 5a a5 68 89 ec 00 00 " //
+ "00 0a 01 20 F0 00 00 00 00 01 99 10 fe 01 01 64 " //