Merge "Bug 5974: He plugin: Don't invalidate session context that is not valid."
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / test / java / org / opendaylight / openflowplugin / extension / vendor / nicira / convertor / IpConverterTest.java
1 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
2
3 import static org.junit.Assert.*;
4
5 import org.junit.Test;
6 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
7
8 public class IpConverterTest {
9
10     @Test
11     public void testIpv4AddressToLong() {
12         Ipv4Address ipAddress = new Ipv4Address("192.168.1.2");
13         long address = 0xc0a80102L;
14         assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
15     }
16
17     @Test
18     public void testIpv4AddressToLong2() {
19         Ipv4Address ipAddress = new Ipv4Address("10.168.1.2");
20         long address = 0x0aa80102L;
21         assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
22     }
23
24 }