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;
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());
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);
ArgumentCaptor.forClass(InstanceIdentifier.class);
setupStubbedDeletes(mockTx1, deletedLinkIDs, deleteLatch);
-
doReturn(mockTx1).when(mockTxChain).newReadWriteTransaction();
exporter.onNodeConnectorRemoved(new NodeConnectorRemovedBuilder().setNodeConnectorRef(
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());
.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 =
assertEquals("getInventoryNodeRef", new NodeRef(invNodeID), augmentation.getInventoryNodeRef());
}
- @SuppressWarnings("rawtypes")
@Test
public void testOnNodeConnectorUpdated() {
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",
}
@Test
- public void testOnLinkRemovedLinkExists() {
+ public void testOnLinkRemoved() {
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
sourceNodeKey = newInvNodeKey("sourceNode");