2 * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.lispflowmapping.implementation.serializer.address;
11 import static org.junit.Assert.assertEquals;
13 import org.junit.Test;
14 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
15 import org.opendaylight.lispflowmapping.tools.junit.BaseTestCase;
16 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
17 import org.opendaylight.yang.gen.v1.lispflowmapping.rev131031.lispaddress.lispaddresscontainer.address.Ipv6;
19 public class LispIpv6AddressTest extends BaseTestCase {
22 public void constructor__Name() throws Exception {
23 Ipv6 ip = LispAFIConvertor.asIPv6AfiAddress("0:0:0:0:0:0:0:0");
25 assertEquals(AddressFamilyNumberEnum.IP6.getIanaCode(), ip.getAfi().shortValue());
26 assertEquals(18, LispAddressSerializer.getInstance().getAddressSize(ip));
27 assertEquals("0:0:0:0:0:0:0:0", ip.getIpv6Address().getValue());
31 public void constructor__Buffer() throws Exception {
32 Ipv6 ip = LispAFIConvertor.asIPv6AfiAddress("0:0:0:0:0:0:0:1");
34 assertEquals(AddressFamilyNumberEnum.IP6.getIanaCode(), ip.getAfi().shortValue());
35 assertEquals(18, LispAddressSerializer.getInstance().getAddressSize(ip));
36 assertEquals("0:0:0:0:0:0:0:1", ip.getIpv6Address().getValue());