Cleaned up source to suppress warnings.
diff --git a/src/test/java/net/onrc/onos/ofcontroller/devicemanager/internal/DeviceStorageImplTestBB.java b/src/test/java/net/onrc/onos/ofcontroller/devicemanager/internal/DeviceStorageImplTestBB.java
index c7c74a5..9964ec3 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/devicemanager/internal/DeviceStorageImplTestBB.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/devicemanager/internal/DeviceStorageImplTestBB.java
@@ -2,6 +2,8 @@
import static org.junit.Assert.*;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.List;
@@ -485,9 +487,10 @@
IDeviceObject dev1 = ope.searchDevice(macAddr);
assertEquals(macAddr, dev1.getMACAddress());
+ int ip_int = getPackedIPv4Address(ip);
//XXX not updated to new interface
- //IDeviceObject dev = deviceImpl.getDeviceByIP(ip);
- IDeviceObject dev = null;
+ IDeviceObject dev = deviceImpl.getDeviceByIP(ip_int);
+ //IDeviceObject dev = null;
assertNotNull(dev);
@@ -656,4 +659,14 @@
}
}
+ int getPackedIPv4Address(String ip) throws UnknownHostException {
+ byte[] bytes = InetAddress.getByName(ip).getAddress();
+
+ int val = 0;
+ for (int i = 0; i < bytes.length; i++) {
+ val <<= 8;
+ val |= bytes[i] & 0xff;
+ }
+ return val;
+ }
}