1 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.test;
3 import static org.junit.Assert.assertEquals;
6 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIPv4SrcConvertor;
7 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.src.grouping.NxmNxTunIpv4Src;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.src.grouping.NxmNxTunIpv4SrcBuilder;
12 public class TunIpv4SrcConverterTest {
14 private static final Ipv4Address IPV4_ADDRESS = new Ipv4Address("1.2.3.4");
15 private static final Long IPV4_LONG = new Long(16909060L);
18 public void testIpv4toLong() {
19 TunIPv4SrcConvertor converter = new TunIPv4SrcConvertor();
20 Long result = converter.ipv4ToLong(IPV4_ADDRESS);
21 assertEquals("Does not match",IPV4_LONG,result);
25 public void testLongtoIpv4() {
26 TunIPv4SrcConvertor converter = new TunIPv4SrcConvertor();
27 Ipv4Address result = converter.longToIpv4Address(16909060L);
28 assertEquals("Does not match",IPV4_ADDRESS,result);