Merge "BUG-650: remove executor abstraction"
[controller.git] / opendaylight / md-sal / topology-manager / src / test / java / org / opendaylight / md / controller / topology / manager / FlowCapableTopologyExporterTest.java
index d07d42f2ec2d1d486d427d7e5dfa2762722d663f..e1d643cd5b2f9230a3b8ea23f0b45e6a23718c21 100644 (file)
@@ -67,7 +67,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
@@ -243,9 +242,8 @@ public class FlowCapableTopologyExporterTest {
         NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
         TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
 
-        InstanceIdentifier<TerminationPoint> topoTermPointII = topologyIID.child(Node.class, topoNodeKey)
-                .child(TerminationPoint.class, terminationPointKey);
-        TerminationPoint topoTermPoint = new TerminationPointBuilder().setKey(terminationPointKey).build();
+        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
+        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
 
         org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
                                                                   nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
@@ -274,10 +272,10 @@ public class FlowCapableTopologyExporterTest {
         doReturn(Futures.makeChecked(readFuture, ReadFailedException.MAPPER)).when(mockTx1)
                 .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
 
-        SettableFuture<Optional<TerminationPoint>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoTermPoint));
+        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
+        readFutureNode.set(Optional.of(topoNode));
         doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx1)
-                .read(LogicalDatastoreType.OPERATIONAL, topoTermPointII);
+                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
 
         CountDownLatch submitLatch1 = setupStubbedSubmit(mockTx1);
 
@@ -287,7 +285,6 @@ public class FlowCapableTopologyExporterTest {
                 ArgumentCaptor.forClass(InstanceIdentifier.class);
         setupStubbedDeletes(mockTx1, deletedLinkIDs, deleteLatch);
 
-
         doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
 
         exporter.onNodeConnectorRemoved(new NodeConnectorRemovedBuilder().setNodeConnectorRef(
@@ -311,9 +308,8 @@ public class FlowCapableTopologyExporterTest {
         NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
         TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
 
-        InstanceIdentifier<TerminationPoint> topoTermPointII = topologyIID.child(Node.class, topoNodeKey)
-                .child(TerminationPoint.class, terminationPointKey);
-        TerminationPoint topoTermPoint = new TerminationPointBuilder().setKey(terminationPointKey).build();
+        InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
+        Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
 
         org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
                 nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
@@ -333,10 +329,10 @@ public class FlowCapableTopologyExporterTest {
                 .read(LogicalDatastoreType.OPERATIONAL, topologyIID);
         CountDownLatch submitLatch = setupStubbedSubmit(mockTx);
 
-        SettableFuture<Optional<TerminationPoint>> readFutureNode = SettableFuture.create();
-        readFutureNode.set(Optional.of(topoTermPoint));
+        SettableFuture<Optional<Node>> readFutureNode = SettableFuture.create();
+        readFutureNode.set(Optional.of(topoNode));
         doReturn(Futures.makeChecked(readFutureNode, ReadFailedException.MAPPER)).when(mockTx)
-                .read(LogicalDatastoreType.OPERATIONAL, topoTermPointII);
+                .read(LogicalDatastoreType.OPERATIONAL, topoNodeII);
 
         CountDownLatch deleteLatch = new CountDownLatch(1);
         ArgumentCaptor<InstanceIdentifier> deletedLinkIDs =
@@ -384,7 +380,6 @@ public class FlowCapableTopologyExporterTest {
         assertEquals("getInventoryNodeRef", new NodeRef(invNodeID), augmentation.getInventoryNodeRef());
     }
 
-    @SuppressWarnings("rawtypes")
     @Test
     public void testOnNodeConnectorUpdated() {
 
@@ -542,7 +537,7 @@ public class FlowCapableTopologyExporterTest {
         waitForSubmit(submitLatch);
 
         ArgumentCaptor<Link> mergedNode = ArgumentCaptor.forClass(Link.class);
-        verify(mockTx).put(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(
+        verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(
                         Link.class, new LinkKey(new LinkId(sourceNodeConnKey.getId())))),
                 mergedNode.capture(), eq(true));
         assertEquals("Source node ID", "sourceNode",
@@ -556,7 +551,7 @@ public class FlowCapableTopologyExporterTest {
     }
 
     @Test
-    public void testOnLinkRemovedLinkExists() {
+    public void testOnLinkRemoved() {
 
         org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
                 sourceNodeKey = newInvNodeKey("sourceNode");