Revert "Changed TopologyManager to ignore edges that contain invalid node connectors." 99/1499/2
authorGiovanni Meo <gmeo@cisco.com>
Mon, 30 Sep 2013 08:21:20 +0000 (10:21 +0200)
committerGiovanni Meo <gmeo@cisco.com>
Mon, 30 Sep 2013 08:31:56 +0000 (10:31 +0200)
This reverts commit d12862677a44f5bf66f8319a8f0e871c35797326.

Signed-off-by: Giovanni Meo <gmeo@cisco.com>
Change-Id: Iaeca384ce8a2ef7c7d59263209d00214e2fa15b4

opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/ISwitchManager.java
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
opendaylight/switchmanager/implementation/src/test/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerTest.java
opendaylight/topologymanager/implementation/pom.xml
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/Activator.java
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImpl.java
opendaylight/topologymanager/implementation/src/test/java/org/opendaylight/controller/topologymanager/internal/.TopologyManagerImplTest.java.swp [deleted file]
opendaylight/topologymanager/implementation/src/test/java/org/opendaylight/controller/topologymanager/internal/TopologyManagerImplTest.java

index 9ac0b5055f071de56ad2afd87e0e65bb8ef3da29..f1b9585d023ab6b4d12cdd55a154cb495dc61d4d 100644 (file)
@@ -335,14 +335,6 @@ public interface ISwitchManager {
      */
     public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
 
      */
     public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
 
-    /**
-     * Test whether the given node connector exists.
-     *
-     * @param nc  {@link org.opendaylight.controller.sal.core.NodeConnector}
-     * @return    True if exists, false otherwise.
-     */
-    public boolean doesNodeConnectorExist(NodeConnector nc);
-
     /**
      * Return controller MAC address
          *
     /**
      * Return controller MAC address
          *
index d3f440090d39d883591140d7aa74bcd429491049..5d0e364116dadd9c2972a6cdda4bc4bb98b0fe06 100644 (file)
@@ -1831,12 +1831,6 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
                 && (state != null) && (state.getValue() == State.EDGE_UP));
     }
 
                 && (state != null) && (state.getValue() == State.EDGE_UP));
     }
 
-    @Override
-    public boolean doesNodeConnectorExist(NodeConnector nc) {
-        return (nc != null && nodeConnectorProps != null
-                && nodeConnectorProps.containsKey(nc));
-    }
-
     @Override
     public String getHelp() {
         StringBuffer help = new StringBuffer();
     @Override
     public String getHelp() {
         StringBuffer help = new StringBuffer();
index e7dac9c143d7d9184bc18d70b340f2155a6c9d5c..97747e9a220922d6c07be06d36a4b3b4938c4cac 100644 (file)
@@ -134,15 +134,10 @@ public class SwitchManagerTest {
             switchmgr.updateNode(tailnc[i - 1].getNode(), UpdateType.ADDED,
                     props);
 
             switchmgr.updateNode(tailnc[i - 1].getNode(), UpdateType.ADDED,
                     props);
 
-            Assert.assertFalse(switchmgr.doesNodeConnectorExist(headnc[i - 1]));
             switchmgr.updateNodeConnector(headnc[i - 1], UpdateType.ADDED,
                     props);
             switchmgr.updateNodeConnector(headnc[i - 1], UpdateType.ADDED,
                     props);
-            Assert.assertTrue(switchmgr.doesNodeConnectorExist(headnc[i - 1]));
-
-            Assert.assertFalse(switchmgr.doesNodeConnectorExist(tailnc[i - 1]));
             switchmgr.updateNodeConnector(tailnc[i - 1], UpdateType.ADDED,
                     props);
             switchmgr.updateNodeConnector(tailnc[i - 1], UpdateType.ADDED,
                     props);
-            Assert.assertTrue(switchmgr.doesNodeConnectorExist(tailnc[i - 1]));
         }
 
         for (int i = 0; i < 5; i++) {
         }
 
         for (int i = 0; i < 5; i++) {
index cc415f14f630c469c980ae2d3af9420c07cadf03..c4a82fe82ff3ba4c035c0cccea45e70a25346835 100755 (executable)
@@ -38,7 +38,6 @@
               org.opendaylight.controller.sal.topology,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.clustering.services,
               org.opendaylight.controller.sal.topology,
               org.opendaylight.controller.configuration,
               org.opendaylight.controller.clustering.services,
-              org.opendaylight.controller.switchmanager,
               org.osgi.service.component,
               org.slf4j,
               org.apache.felix.dm,
               org.osgi.service.component,
               org.slf4j,
               org.apache.felix.dm,
       <artifactId>configuration</artifactId>
       <version>0.4.1-SNAPSHOT</version>
     </dependency>
       <artifactId>configuration</artifactId>
       <version>0.4.1-SNAPSHOT</version>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>switchmanager</artifactId>
-      <version>0.5.0-SNAPSHOT</version>
-    </dependency>
   </dependencies>
 </project>
   </dependencies>
 </project>
index b2a096aa7b36c3d3c85a2a54a9bbefe5b05e2836..30a9445b1d5582fe1f78573d4a7b0e0e28674a5e 100644 (file)
@@ -21,7 +21,6 @@ import org.opendaylight.controller.configuration.IConfigurationContainerAware;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.topology.IListenTopoUpdates;
 import org.opendaylight.controller.sal.topology.ITopologyService;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.topology.IListenTopoUpdates;
 import org.opendaylight.controller.sal.topology.ITopologyService;
-import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
 import org.opendaylight.controller.topologymanager.ITopologyManagerAware;
 import org.opendaylight.controller.topologymanager.ITopologyManagerClusterWideAware;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
 import org.opendaylight.controller.topologymanager.ITopologyManagerAware;
 import org.opendaylight.controller.topologymanager.ITopologyManagerClusterWideAware;
@@ -79,10 +78,6 @@ public class Activator extends ComponentActivatorAbstractBase {
                     ITopologyService.class).setCallbacks("setTopoService",
                     "unsetTopoService").setRequired(true));
 
                     ITopologyService.class).setCallbacks("setTopoService",
                     "unsetTopoService").setRequired(true));
 
-            c.add(createContainerServiceDependency(containerName).setService(
-                    ISwitchManager.class).setCallbacks("setSwitchManager",
-                    "unsetSwitchManager").setRequired(true));
-
             // These are all the listeners for a topology manager
             // updates, there could be many or none
             c.add(createContainerServiceDependency(containerName).setService(
             // These are all the listeners for a topology manager
             // updates, there could be many or none
             c.add(createContainerServiceDependency(containerName).setService(
index b905a8982e83113e10b23261ab2d3045f1142c54..5ecddcfc88bd501e65164303e946a29ef36ec46e 100644 (file)
@@ -53,7 +53,6 @@ import org.opendaylight.controller.sal.utils.ObjectReader;
 import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.sal.utils.ObjectWriter;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
-import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
 import org.opendaylight.controller.topologymanager.ITopologyManagerAware;
 import org.opendaylight.controller.topologymanager.ITopologyManagerClusterWideAware;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
 import org.opendaylight.controller.topologymanager.ITopologyManagerAware;
 import org.opendaylight.controller.topologymanager.ITopologyManagerClusterWideAware;
@@ -82,7 +81,6 @@ public class TopologyManagerImpl implements
     private static final Logger log = LoggerFactory.getLogger(TopologyManagerImpl.class);
     private ITopologyService topoService;
     private IClusterContainerServices clusterContainerService;
     private static final Logger log = LoggerFactory.getLogger(TopologyManagerImpl.class);
     private ITopologyService topoService;
     private IClusterContainerServices clusterContainerService;
-    private ISwitchManager switchManager;
     // DB of all the Edges with properties which constitute our topology
     private ConcurrentMap<Edge, Set<Property>> edgesDB;
     // DB of all NodeConnector which are part of ISL Edges, meaning they
     // DB of all the Edges with properties which constitute our topology
     private ConcurrentMap<Edge, Set<Property>> edgesDB;
     // DB of all NodeConnector which are part of ISL Edges, meaning they
@@ -163,18 +161,6 @@ public class TopologyManagerImpl implements
         }
     }
 
         }
     }
 
-    void setSwitchManager(ISwitchManager s) {
-        log.debug("Adding ISwitchManager: {}", s);
-        this.switchManager = s;
-    }
-
-    void unsetSwitchManager(ISwitchManager s) {
-        if (this.switchManager == s) {
-            log.debug("Removing ISwitchManager: {}", s);
-            this.switchManager = null;
-        }
-    }
-
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
@@ -521,22 +507,9 @@ public class TopologyManagerImpl implements
         }
     }
 
         }
     }
 
-    private boolean nodeConnectorsExist(Edge e) {
-        NodeConnector head = e.getHeadNodeConnector();
-        NodeConnector tail = e.getTailNodeConnector();
-        return (switchManager.doesNodeConnectorExist(head) &&
-                switchManager.doesNodeConnectorExist(tail));
-    }
-
     private TopoEdgeUpdate edgeUpdate(Edge e, UpdateType type, Set<Property> props) {
         switch (type) {
         case ADDED:
     private TopoEdgeUpdate edgeUpdate(Edge e, UpdateType type, Set<Property> props) {
         switch (type) {
         case ADDED:
-            // Ensure that both tail and head node connectors exist.
-            if (!nodeConnectorsExist(e)) {
-                log.warn("Ignore edge that contains invalid node connector: {}", e);
-                return null;
-            }
-
             // Make sure the props are non-null
             if (props == null) {
                 props = new HashSet<Property>();
             // Make sure the props are non-null
             if (props == null) {
                 props = new HashSet<Property>();
@@ -658,21 +631,18 @@ public class TopologyManagerImpl implements
             Set<Property> p = topoedgeupdateList.get(i).getProperty();
             UpdateType type = topoedgeupdateList.get(i).getUpdateType();
             TopoEdgeUpdate teu = edgeUpdate(e, type, p);
             Set<Property> p = topoedgeupdateList.get(i).getProperty();
             UpdateType type = topoedgeupdateList.get(i).getUpdateType();
             TopoEdgeUpdate teu = edgeUpdate(e, type, p);
-            if (teu != null) {
-                teuList.add(teu);
-            }
+            teuList.add(teu);
         }
 
         }
 
-        if (!teuList.isEmpty()) {
-            // Now update the listeners
-            for (ITopologyManagerAware s : this.topologyManagerAware) {
-                try {
-                    s.edgeUpdate(teuList);
-                } catch (Exception exc) {
-                    log.error("Exception on edge update:", exc);
-                }
+        // Now update the listeners
+        for (ITopologyManagerAware s : this.topologyManagerAware) {
+            try {
+                s.edgeUpdate(teuList);
+            } catch (Exception exc) {
+                log.error("Exception on edge update:", exc);
             }
         }
             }
         }
+
     }
 
     private Edge getReverseLinkTuple(TopologyUserLinkConfig link) {
     }
 
     private Edge getReverseLinkTuple(TopologyUserLinkConfig link) {
@@ -722,14 +692,7 @@ public class TopologyManagerImpl implements
         Edge linkTuple = getLinkTuple(userLink);
         if (linkTuple != null) {
             if (!isProductionLink(linkTuple)) {
         Edge linkTuple = getLinkTuple(userLink);
         if (linkTuple != null) {
             if (!isProductionLink(linkTuple)) {
-                TopoEdgeUpdate teu = edgeUpdate(linkTuple, UpdateType.ADDED,
-                                                new HashSet<Property>());
-                if (teu == null) {
-                    userLinksDB.remove(userLink.getName());
-                    return new Status(StatusCode.NOTFOUND,
-                           "Link configuration contains invalid node connector: "
-                           + userLink);
-                }
+                edgeUpdate(linkTuple, UpdateType.ADDED, new HashSet<Property>());
             }
 
             linkTuple = getReverseLinkTuple(userLink);
             }
 
             linkTuple = getReverseLinkTuple(userLink);
diff --git a/opendaylight/topologymanager/implementation/src/test/java/org/opendaylight/controller/topologymanager/internal/.TopologyManagerImplTest.java.swp b/opendaylight/topologymanager/implementation/src/test/java/org/opendaylight/controller/topologymanager/internal/.TopologyManagerImplTest.java.swp
deleted file mode 100644 (file)
index 6894890..0000000
Binary files a/opendaylight/topologymanager/implementation/src/test/java/org/opendaylight/controller/topologymanager/internal/.TopologyManagerImplTest.java.swp and /dev/null differ
index cb63cd105a618d301cdccb888ae6bf23217fbd69..65487a614a85af96fabbac4e7df289d2f28c20e8 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.topologymanager.internal;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -29,280 +28,17 @@ import org.opendaylight.controller.sal.core.Latency;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.Node.NodeIDType;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.Node.NodeIDType;
 import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.State;
 import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.sal.packet.address.EthernetAddress;
 import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
 import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.State;
 import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.sal.packet.address.EthernetAddress;
 import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
-import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
 import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
-import org.opendaylight.controller.switchmanager.ISwitchManager;
-import org.opendaylight.controller.switchmanager.SpanConfig;
-import org.opendaylight.controller.switchmanager.Subnet;
-import org.opendaylight.controller.switchmanager.SubnetConfig;
-import org.opendaylight.controller.switchmanager.Switch;
-import org.opendaylight.controller.switchmanager.SwitchConfig;
 import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig;
 
 public class TopologyManagerImplTest {
 import org.opendaylight.controller.topologymanager.TopologyUserLinkConfig;
 
 public class TopologyManagerImplTest {
-    /**
-     * Mockup of switch manager that only maintains existence of node
-     * connector.
-     */
-    private final class TestSwitchManager implements ISwitchManager {
-        private final Set<Node>  nodeSet = new HashSet<Node>();
-        private final Set<NodeConnector> nodeConnectorSet =
-            new HashSet<NodeConnector>();
-
-        private void addNodeConnectors(NodeConnector ... connectors) {
-            for (NodeConnector nc: connectors) {
-                if (nc != null) {
-                    nodeSet.add(nc.getNode());
-                    nodeConnectorSet.add(nc);
-                }
-            }
-        }
-
-        private void addNodeConnectors(TopologyUserLinkConfig ... links) {
-            for (TopologyUserLinkConfig link: links) {
-                NodeConnector src =
-                    NodeConnector.fromString(link.getSrcNodeConnector());
-                NodeConnector dst =
-                    NodeConnector.fromString(link.getDstNodeConnector());
-                addNodeConnectors(src, dst);
-            }
-        }
-
-        @Override
-        public Status addSubnet(SubnetConfig configObject) {
-            return null;
-        }
-
-        @Override
-        public Status removeSubnet(SubnetConfig configObject) {
-            return null;
-        }
-
-        @Override
-        public Status modifySubnet(SubnetConfig configObject) {
-            return null;
-        }
-
-        @Override
-        public Status removeSubnet(String name) {
-            return null;
-        }
-
-        @Override
-        public List<Switch> getNetworkDevices() {
-            return null;
-        }
-
-        @Override
-        public List<SubnetConfig> getSubnetsConfigList() {
-            return null;
-        }
-
-        @Override
-        public SubnetConfig getSubnetConfig(String subnet) {
-            return null;
-        }
-
-        @Override
-        public Subnet getSubnetByNetworkAddress(InetAddress networkAddress) {
-            return null;
-        }
-
-        @Override
-        public Status saveSwitchConfig() {
-            return null;
-        }
-
-        @Override
-        public Status addSpanConfig(SpanConfig configObject) {
-            return null;
-        }
-
-        @Override
-        public Status removeSpanConfig(SpanConfig cfgObject) {
-            return null;
-        }
-
-        @Override
-        public List<SpanConfig> getSpanConfigList() {
-            return null;
-        }
-
-        @Override
-        public List<NodeConnector> getSpanPorts(Node node) {
-            return null;
-        }
-
-        @Override
-        public void updateSwitchConfig(SwitchConfig cfgObject) {
-        }
-
-        @Override
-        public Status updateNodeConfig(SwitchConfig switchConfig) {
-            return null;
-        }
-
-        @Override
-        public Status removeNodeConfig(String nodeId) {
-            return null;
-        }
-
-        @Override
-        public SwitchConfig getSwitchConfig(String nodeId) {
-            return null;
-        }
-
-        @Override
-        public Status addPortsToSubnet(String name, List<String> nodeConnectors) {
-            return null;
-        }
-
-        @Override
-        public Status removePortsFromSubnet(String name, List<String> nodeConnectors) {
-            return null;
-        }
-
-        @Override
-        public Set<Node> getNodes() {
-            return new HashSet<Node>(nodeSet);
-        }
-
-        @Override
-        public Map<String, Property> getNodeProps(Node node) {
-            return new HashMap<String, Property>();
-        }
-
-        @Override
-        public Property getNodeProp(Node node, String propName) {
-            return null;
-        }
-
-        @Override
-        public void setNodeProp(Node node, Property prop) {
-        }
-
-        @Override
-        public Status removeNodeProp(Node node, String propName) {
-            return null;
-        }
-
-        @Override
-        public Status removeNodeAllProps(Node node) {
-            return null;
-        }
-
-        @Override
-        public Set<NodeConnector> getUpNodeConnectors(Node node) {
-            return getNodeConnectors(node);
-        }
-
-        @Override
-        public Set<NodeConnector> getNodeConnectors(Node node) {
-            Set<NodeConnector> set = new HashSet<NodeConnector>();
-            for (NodeConnector nc: nodeConnectorSet) {
-                if (nc.getNode().equals(node)) {
-                    set.add(nc);
-                }
-            }
-
-            return set;
-        }
-
-        @Override
-        public Set<NodeConnector> getPhysicalNodeConnectors(Node node) {
-            return getNodeConnectors(node);
-        }
-
-        @Override
-        public Map<String, Property> getNodeConnectorProps(NodeConnector nodeConnector) {
-            return new HashMap<String, Property>();
-        }
-
-        @Override
-        public Property getNodeConnectorProp(NodeConnector nodeConnector, String propName) {
-            return null;
-        }
-
-        @Override
-        public Status addNodeConnectorProp(NodeConnector nodeConnector, Property prop) {
-            return null;
-        }
-
-        @Override
-        public Status removeNodeConnectorProp(NodeConnector nc, String propName) {
-            return null;
-        }
-
-        @Override
-        public Status removeNodeConnectorAllProps(NodeConnector nodeConnector) {
-            return null;
-        }
-
-        @Override
-        public NodeConnector getNodeConnector(Node node, String nodeConnectorName) {
-            return null;
-        }
-
-        @Override
-        public boolean isSpecial(NodeConnector p) {
-            String type = p.getType();
-            return (type.equals(NodeConnectorIDType.CONTROLLER)
-                    || type.equals(NodeConnectorIDType.ALL)
-                    || type.equals(NodeConnectorIDType.SWSTACK)
-                    || type.equals(NodeConnectorIDType.HWPATH));
-        }
-
-        @Override
-        public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector) {
-            if (doesNodeConnectorExist(nodeConnector)) {
-                return Boolean.TRUE;
-            }
-            return Boolean.FALSE;
-        }
-
-        @Override
-        public boolean doesNodeConnectorExist(NodeConnector nc) {
-            return (nc != null && nodeConnectorSet.contains(nc));
-        }
-
-        @Override
-        public byte[] getControllerMAC() {
-            return new byte[6];
-        }
-
-        @Override
-        public byte[] getNodeMAC(Node node) {
-            return new byte[6];
-        }
-
-        @Override
-        public boolean isHostRefreshEnabled() {
-            return true;
-        }
-
-        @Override
-        public int getHostRetryCount() {
-            return 1;
-        }
-
-        @Override
-        public Property createProperty(String propName, String propValue) {
-            return null;
-        }
-
-        @Override
-        public String getNodeDescription(Node node) {
-            return null;
-        }
-    }
 
     /*
      * Sets the node, edges and properties for edges here: Edge <SwitchId :
 
     /*
      * Sets the node, edges and properties for edges here: Edge <SwitchId :
@@ -314,7 +50,7 @@ public class TopologyManagerImplTest {
      *
      * @throws ConstructionException
      */
      *
      * @throws ConstructionException
      */
-    public void setNodeEdges(TopologyManagerImpl topoManagerImpl, TestSwitchManager swMgr)
+    public void setNodeEdges(TopologyManagerImpl topoManagerImpl)
             throws ConstructionException {
         topoManagerImpl.nonClusterObjectCreate();
 
             throws ConstructionException {
         topoManagerImpl.nonClusterObjectCreate();
 
@@ -337,7 +73,6 @@ public class TopologyManagerImplTest {
             NodeConnector tailnc1 = NodeConnectorCreator
                     .createOFNodeConnector((short) (i + 10),
                             NodeCreator.createOFNode((long) (i + 10)));
             NodeConnector tailnc1 = NodeConnectorCreator
                     .createOFNodeConnector((short) (i + 10),
                             NodeCreator.createOFNode((long) (i + 10)));
-            swMgr.addNodeConnectors(tailnc1, headnc1);
             Edge e1 = new Edge(tailnc1, headnc1);
             TopoEdgeUpdate teu1 = new TopoEdgeUpdate(e1, props,
                     UpdateType.ADDED);
             Edge e1 = new Edge(tailnc1, headnc1);
             TopoEdgeUpdate teu1 = new TopoEdgeUpdate(e1, props,
                     UpdateType.ADDED);
@@ -347,21 +82,20 @@ public class TopologyManagerImplTest {
                     (short) (i + 1), headnc1.getNode());
             NodeConnector headnc2 = NodeConnectorCreator.createOFNodeConnector(
                     (short) (i + 11), tailnc1.getNode());
                     (short) (i + 1), headnc1.getNode());
             NodeConnector headnc2 = NodeConnectorCreator.createOFNodeConnector(
                     (short) (i + 11), tailnc1.getNode());
-            swMgr.addNodeConnectors(tailnc1, headnc2);
             Edge e2 = new Edge(tailnc2, headnc2);
             TopoEdgeUpdate teu2 = new TopoEdgeUpdate(e2, props,
                     UpdateType.ADDED);
             topoedgeupdateList.add(teu2);
             topoManagerImpl.edgeUpdate(topoedgeupdateList);
             Edge e2 = new Edge(tailnc2, headnc2);
             TopoEdgeUpdate teu2 = new TopoEdgeUpdate(e2, props,
                     UpdateType.ADDED);
             topoedgeupdateList.add(teu2);
             topoManagerImpl.edgeUpdate(topoedgeupdateList);
+
         }
         }
+
     }
 
     @Test
     public void testGetNodeEdges() throws ConstructionException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
     }
 
     @Test
     public void testGetNodeEdges() throws ConstructionException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
-        setNodeEdges(topoManagerImpl, swMgr);
+        setNodeEdges(topoManagerImpl);
 
         Map<Node, Set<Edge>> nodeEdgeMap = topoManagerImpl.getNodeEdges();
         for (Iterator<Map.Entry<Node, Set<Edge>>> i = nodeEdgeMap.entrySet()
 
         Map<Node, Set<Edge>> nodeEdgeMap = topoManagerImpl.getNodeEdges();
         for (Iterator<Map.Entry<Node, Set<Edge>>> i = nodeEdgeMap.entrySet()
@@ -392,9 +126,7 @@ public class TopologyManagerImplTest {
     @Test
     public void testGetEdges() throws ConstructionException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
     @Test
     public void testGetEdges() throws ConstructionException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
-        setNodeEdges(topoManagerImpl, swMgr);
+        setNodeEdges(topoManagerImpl);
 
         Map<Edge, Set<Property>> edgeProperty = topoManagerImpl.getEdges();
 
 
         Map<Edge, Set<Property>> edgeProperty = topoManagerImpl.getEdges();
 
@@ -476,12 +208,8 @@ public class TopologyManagerImplTest {
                 "OF|10@OF|20", "OF|10@OF|20");
 
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
                 "OF|10@OF|20", "OF|10@OF|20");
 
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
         topoManagerImpl.nonClusterObjectCreate();
 
         topoManagerImpl.nonClusterObjectCreate();
 
-        swMgr.addNodeConnectors(link1, link2, link3, link4);
-
         Assert.assertTrue(topoManagerImpl.addUserLink(link1).isSuccess());
         Assert.assertTrue(topoManagerImpl.addUserLink(link2).getCode() == StatusCode.CONFLICT);
         Assert.assertTrue(topoManagerImpl.addUserLink(link3).getCode() == StatusCode.CONFLICT);
         Assert.assertTrue(topoManagerImpl.addUserLink(link1).isSuccess());
         Assert.assertTrue(topoManagerImpl.addUserLink(link2).getCode() == StatusCode.CONFLICT);
         Assert.assertTrue(topoManagerImpl.addUserLink(link3).getCode() == StatusCode.CONFLICT);
@@ -494,14 +222,6 @@ public class TopologyManagerImplTest {
                 .isSuccess());
         Assert.assertTrue(topoManagerImpl.getUserLinks().isEmpty());
 
                 .isSuccess());
         Assert.assertTrue(topoManagerImpl.getUserLinks().isEmpty());
 
-        TopologyUserLinkConfig badlink1 =
-            new TopologyUserLinkConfig("bad1", "OF|1@OF|2", "OF|1@OF|3");
-        TopologyUserLinkConfig badlink2 =
-            new TopologyUserLinkConfig("bad2", "OF|10@OF|21", "OF|10@OF|20");
-        Assert.assertEquals(StatusCode.NOTFOUND,
-                            topoManagerImpl.addUserLink(badlink1).getCode());
-        Assert.assertEquals(StatusCode.NOTFOUND,
-                            topoManagerImpl.addUserLink(badlink2).getCode());
     }
 
     @Test
     }
 
     @Test
@@ -509,8 +229,6 @@ public class TopologyManagerImplTest {
         TopologyUserLinkConfig[] link = new TopologyUserLinkConfig[5];
         TopologyUserLinkConfig[] reverseLink = new TopologyUserLinkConfig[5];
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
         TopologyUserLinkConfig[] link = new TopologyUserLinkConfig[5];
         TopologyUserLinkConfig[] reverseLink = new TopologyUserLinkConfig[5];
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
         topoManagerImpl.nonClusterObjectCreate();
 
         String name = "Test";
         topoManagerImpl.nonClusterObjectCreate();
 
         String name = "Test";
@@ -567,11 +285,7 @@ public class TopologyManagerImplTest {
             Assert.assertTrue(link[i].isValid() == true);
 
             reverseLink[i] = new TopologyUserLinkConfig(name, dstNodeConnector, srcNodeConnector);
             Assert.assertTrue(link[i].isValid() == true);
 
             reverseLink[i] = new TopologyUserLinkConfig(name, dstNodeConnector, srcNodeConnector);
-
-            Assert.assertEquals(StatusCode.NOTFOUND,
-                                topoManagerImpl.addUserLink(link[i]).getCode());
-            swMgr.addNodeConnectors(link[i]);
-            Assert.assertTrue(topoManagerImpl.addUserLink(link[i]).isSuccess());
+            topoManagerImpl.addUserLink(link[i]);
         }
 
         ConcurrentMap<String, TopologyUserLinkConfig> userLinks = topoManagerImpl
         }
 
         ConcurrentMap<String, TopologyUserLinkConfig> userLinks = topoManagerImpl
@@ -594,8 +308,6 @@ public class TopologyManagerImplTest {
     public void testHostLinkMethods() throws ConstructionException,
     UnknownHostException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
     public void testHostLinkMethods() throws ConstructionException,
     UnknownHostException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
         topoManagerImpl.nonClusterObjectCreate();
         int hostCounter = 0;
 
         topoManagerImpl.nonClusterObjectCreate();
         int hostCounter = 0;
 
@@ -657,8 +369,6 @@ public class TopologyManagerImplTest {
     public void testGetNodesWithNodeConnectorHost()
             throws ConstructionException, UnknownHostException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
     public void testGetNodesWithNodeConnectorHost()
             throws ConstructionException, UnknownHostException {
         TopologyManagerImpl topoManagerImpl = new TopologyManagerImpl();
-        TestSwitchManager swMgr = new TestSwitchManager();
-        topoManagerImpl.setSwitchManager(swMgr);
         topoManagerImpl.nonClusterObjectCreate();
         int hostCounter = 0;
 
         topoManagerImpl.nonClusterObjectCreate();
         int hostCounter = 0;