Add missing license headers
[openflowplugin.git] / extension / openflowplugin-extension-nicira / src / test / java / org / opendaylight / openflowplugin / extension / vendor / nicira / convertor / IpConverterTest.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
9
10 import static org.junit.Assert.*;
11
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
14
15 public class IpConverterTest {
16
17     @Test
18     public void testIpv4AddressToLong() {
19         Ipv4Address ipAddress = new Ipv4Address("192.168.1.2");
20         long address = 0xc0a80102L;
21         assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
22     }
23
24     @Test
25     public void testIpv4AddressToLong2() {
26         Ipv4Address ipAddress = new Ipv4Address("10.168.1.2");
27         long address = 0x0aa80102L;
28         assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
29     }
30
31 }