Merge remote-tracking branch 'origin/master' into merge-branch
[netvirt.git] / plugin / src / test / java / org / opendaylight / ovsdb / plugin / OvsdbTestDeletePortIT.java
index dd5925862f276fc6f63f885a8f9af693c209512c..3fd246d3134e535f4a05d10d2c868499163ee569 100644 (file)
@@ -11,35 +11,19 @@ package org.opendaylight.ovsdb.plugin;
 
 import org.junit.Test;
 import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.connection.ConnectionConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.Map;
-
-public class OvsdbTestDeletePortIT {
+public class OvsdbTestDeletePortIT extends OvsdbTestBase {
     private static final Logger logger = LoggerFactory
             .getLogger(OvsdbTestAddPortIT.class);
 
     @Test
     public void deletePort() throws Throwable{
-        Node.NodeIDType.registerIDType("OVS", String.class);
-        NodeConnector.NodeConnectorIDType.registerIDType("OVS", String.class, "OVS");
-
-        ConnectionService connectionService = new ConnectionService();
-        connectionService.init();
-        String identifier = "TEST";
-        Map<ConnectionConstants, String> params = new HashMap<ConnectionConstants, String>();
-        params.put(ConnectionConstants.ADDRESS, "10.12.0.78");
-        params.put(ConnectionConstants.PORT, "6634");
+        TestObjects testObjects = getTestConnection();
+        ConnectionService connectionService = testObjects.connectionService;
+        Node node = testObjects.node;
 
-        Node node = connectionService.connect(identifier, params);
-        if(node == null){
-            logger.error("Could not connect to ovsdb server");
-            return;
-        }
         /**
          * Deletes an existing port from an existing bridge
          * Ex. ovs-vsctl del-port ovsbr0 tap0
@@ -49,6 +33,6 @@ public class OvsdbTestDeletePortIT {
          */
         ConfigurationService configurationService = new ConfigurationService();
         configurationService.setConnectionServiceInternal(connectionService);
-        configurationService.deletePort(node, "ovsbr0", "tap2");
+        configurationService.deletePort(node, BRIDGE_NAME, PORT_NAME);
     }
 }