1 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
3 import static org.junit.Assert.assertEquals;
5 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.MatchUtil;
8 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
10 public class MatchUtilTest {
12 private static final Ipv4Address IPV4_ADDRESS = new Ipv4Address("1.2.3.4");
13 private static final Long IPV4_LONG = new Long(16909060L);
16 public void testIpv4toLong() {
17 final Long result = MatchUtil.ipv4ToLong(IPV4_ADDRESS);
18 assertEquals("Does not match",IPV4_LONG,result);
22 public void testLongtoIpv4() {
23 Ipv4Address result = MatchUtil.longToIpv4Address(16909060L);
24 assertEquals("Does not match",IPV4_ADDRESS,result);