1 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.test;
3 import static org.junit.Assert.assertEquals;
5 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIPv4SrcConvertor;
6 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
8 public class TunIpv4SrcConverterTest {
10 private static final Ipv4Address IPV4_ADDRESS = new Ipv4Address("1.2.3.4");
11 private static final Long IPV4_LONG = new Long(16909060L);
14 public void testIpv4toLong() {
15 TunIPv4SrcConvertor converter = new TunIPv4SrcConvertor();
16 Long result = converter.ipv4ToLong(IPV4_ADDRESS);
17 assertEquals("Does not match",IPV4_LONG,result);
21 public void testLongtoIpv4() {
22 TunIPv4SrcConvertor converter = new TunIPv4SrcConvertor();
23 Ipv4Address result = converter.longToIpv4Address(16909060L);
24 assertEquals("Does not match",IPV4_ADDRESS,result);