Remove old test code from LinkStorageImpl
diff --git a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java
index 5a9bce2..ac76def 100644
--- a/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java
+++ b/src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImpl.java
@@ -200,31 +200,7 @@
// TODO: Fix me
@Override
public List<Link> getLinks(Long dpid, short port) {
- IPortObject vportSrc, vportDst;
List<Link> links = null;
- Link lt;
-
- vportSrc = dbop.searchPort(HexString.toHexString(dpid), port);
- if (vportSrc != null) {
-
- for (Edge e : vportSrc.asVertex().getEdges(Direction.IN)) {
- if(e.getLabel().equals("link")) {
- Vertex v = e.getVertex(Direction.OUT);
- short dst_port = v.getProperty("number");
- for(Edge e2 : v.getEdges(Direction.IN)) {
- if(e2.getLabel().equals("on")) {
- Vertex v2 = e2.getVertex(Direction.OUT);
- long dst_dpid = HexString.toLong((String) v2.getProperty("dpid"));
-
- Link lt = new Link(dpid, port, dst_dpid, dst_port);
- links.add(lt);
- }
- }
- }
- }
- }
- // END: Trial code
-
return links;
}
@@ -264,21 +240,8 @@
// TODO: Fix me
@Override
public List<Link> getLinks(String dpid) {
- GraphDBConnection conn = GraphDBConnection.getInstance(this.conf);
- ISwitchObject vswitch;
List<Link> links = new ArrayList<Link>();
- // BEGIN: Trial code
- // author: Naoki Shiota
- vswitch = conn.utils().searchSwitch(conn, dpid);
-
- for(IPortObject vportSrc : vswitch.getPorts()) {
- // array concatenation may be heavy...
- List<Link> sublinks = getLinks(HexString.toLong(dpid), vportSrc.getNumber());
- links.addAll(sublinks);
- }
- // END: Trial code
-
return links;
}
diff --git a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java
index fd1d7d0..0968fef 100644
--- a/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java
+++ b/src/test/java/net/floodlightcontroller/linkdiscovery/internal/LinkStorageImplTest.java
@@ -7,12 +7,8 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
-
-import junit.framework.Assert;
import net.floodlightcontroller.core.internal.TestDatabaseManager;
-import net.floodlightcontroller.linkdiscovery.ILinkStorage;
import net.floodlightcontroller.linkdiscovery.LinkInfo;
import net.floodlightcontroller.routing.Link;
import net.onrc.onos.ofcontroller.core.INetMapStorage.DM_OPERATION;
@@ -25,7 +21,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openflow.protocol.OFPhysicalPort;
-import org.openflow.protocol.OFPhysicalPort.OFPortState;
import org.openflow.util.HexString;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;