Moved ARP cache REST API under web package.
- Replaced deprecated JUnit method
Change-Id: I5abbf496c736fcb64858e10f465f3c2b6545ccdf
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
index 25d4646..a148f0a 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/ProxyArpManager.java
@@ -20,6 +20,7 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.api.packet.IPacketListener;
import net.onrc.onos.api.packet.IPacketService;
+import net.onrc.onos.apps.proxyarp.web.ArpWebRoutable;
import net.onrc.onos.apps.sdnip.Interface;
import net.onrc.onos.core.datagrid.IDatagridService;
import net.onrc.onos.core.datagrid.IEventChannel;
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ArpCacheResource.java b/src/main/java/net/onrc/onos/apps/proxyarp/web/ArpCacheResource.java
similarity index 86%
rename from src/main/java/net/onrc/onos/apps/proxyarp/ArpCacheResource.java
rename to src/main/java/net/onrc/onos/apps/proxyarp/web/ArpCacheResource.java
index 70818c9..4e6b26e 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ArpCacheResource.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/web/ArpCacheResource.java
@@ -1,7 +1,9 @@
-package net.onrc.onos.apps.proxyarp;
+package net.onrc.onos.apps.proxyarp.web;
import java.util.List;
+import net.onrc.onos.apps.proxyarp.IProxyArpService;
+
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
diff --git a/src/main/java/net/onrc/onos/apps/proxyarp/ArpWebRoutable.java b/src/main/java/net/onrc/onos/apps/proxyarp/web/ArpWebRoutable.java
similarity index 95%
rename from src/main/java/net/onrc/onos/apps/proxyarp/ArpWebRoutable.java
rename to src/main/java/net/onrc/onos/apps/proxyarp/web/ArpWebRoutable.java
index 82847f2..7cfa2c1 100644
--- a/src/main/java/net/onrc/onos/apps/proxyarp/ArpWebRoutable.java
+++ b/src/main/java/net/onrc/onos/apps/proxyarp/web/ArpWebRoutable.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.apps.proxyarp;
+package net.onrc.onos.apps.proxyarp.web;
import net.floodlightcontroller.restserver.RestletRoutable;
diff --git a/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java b/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
index 73d37ea..13385f4 100644
--- a/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
+++ b/src/test/java/net/onrc/onos/apps/proxyarp/ProxyArpManagerTest.java
@@ -2,6 +2,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -11,12 +12,12 @@
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
import net.floodlightcontroller.core.IFloodlightProviderService;
import net.floodlightcontroller.core.module.FloodlightModuleContext;
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.api.packet.IPacketService;
+import net.onrc.onos.apps.proxyarp.web.ArpWebRoutable;
import net.onrc.onos.core.datagrid.IDatagridService;
import net.onrc.onos.core.datagrid.IEventChannel;
import net.onrc.onos.core.datagrid.IEventChannelListener;
@@ -185,13 +186,15 @@
//Made tested objects
arpCache = new ArpCache();
- arpCacheComparisonList = new ArrayList<String>();
+ arpCache.setArpEntryTimeoutConfig(Long.parseLong(defaultStrCleanupMsec));
arpCache.update(cachedIp1, cachedMac1);
+ arpCache.update(cachedIp2, cachedMac2);
+
+ arpCacheComparisonList = new ArrayList<String>();
arpCacheComparisonList.add(cachedStrIp1
+ " => "
+ cachedStrMac1
+ " : VALID");
- arpCache.update(cachedIp2, cachedMac2);
arpCacheComparisonList.add(cachedStrIp2
+ " => "
+ cachedStrMac2
@@ -247,7 +250,7 @@
try {
PowerMock.expectNew(ArpCache.class).andReturn(arpCache);
} catch (Exception e) {
- Assert.fail("Exception:" + e.getMessage());
+ fail("Exception:" + e.getMessage());
}
PowerMock.replayAll();
EasyMock.expect(configInfoService.getVlan()).andReturn(vlanId);
@@ -269,6 +272,7 @@
@After
public void tearDown() throws Exception {
+ arpCache = null;
}
@Test