import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
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.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.api.source.YangTextSource;
import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
-import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
-import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
+import org.opendaylight.yangtools.yang.model.spi.source.DelegatedYangTextSource;
import org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository;
import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
SOURCE_IDENTIFIERS.stream().map(
sourceId -> masterSchemaRepository.registerSchemaSource(
- id -> Futures.immediateFuture(YangTextSchemaSource.delegateForCharSource(id,
+ id -> Futures.immediateFuture(new DelegatedYangTextSource(id,
CharSource.wrap(yangTemplate.replaceAll("ID", id.name().getLocalName())))),
- PotentialSchemaSource.create(sourceId, YangTextSchemaSource.class, 1)))
+ PotentialSchemaSource.create(sourceId, YangTextSource.class, 1)))
.collect(Collectors.toList());
NetconfTopologySetup masterSetup = NetconfTopologySetup.builder()
public void testSlaveMountPointRegistration() throws InterruptedException, ExecutionException, TimeoutException {
initializeMaster();
- ListenerRegistration<?> mockListenerReg = mock(ListenerRegistration.class);
- doReturn(mockListenerReg).when(mockDataBroker).registerDataTreeChangeListener(any(), any());
+ Registration mockListenerReg = mock(Registration.class);
+ doReturn(mockListenerReg).when(mockDataBroker).registerTreeChangeListener(any(), any());
final NodeId nodeId = new NodeId("device");
final NodeKey nodeKey = new NodeKey(nodeId);
nodeKey, topologyId);
netconfNodeManager.registerDataTreeChangeListener(topologyId, nodeKey);
- verify(mockDataBroker).registerDataTreeChangeListener(any(), eq(netconfNodeManager));
+ verify(mockDataBroker).registerTreeChangeListener(any(), eq(netconfNodeManager));
// Invoke onDataTreeChanged with a NetconfNode WRITE to simulate the master writing the operational state to
// Connected. Expect the slave mount point created and registered.
final Node node = new NodeBuilder().setNodeId(nodeId).addAugmentation(netconfNode).build();
DataObjectModification<Node> mockDataObjModification = mock(DataObjectModification.class);
- doReturn(Iterables.getLast(nodeListPath.getPathArguments())).when(mockDataObjModification).getIdentifier();
- doReturn(WRITE).when(mockDataObjModification).getModificationType();
- doReturn(node).when(mockDataObjModification).getDataAfter();
+ doReturn(Iterables.getLast(nodeListPath.getPathArguments())).when(mockDataObjModification).step();
+ doReturn(WRITE).when(mockDataObjModification).modificationType();
+ doReturn(node).when(mockDataObjModification).dataAfter();
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointBuilder, timeout(5000)).register();
// Notify that the NetconfNode operational state was deleted. Expect the slave mount point closed.
- doReturn(DELETE).when(mockDataObjModification).getModificationType();
+ doReturn(DELETE).when(mockDataObjModification).modificationType();
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointReg, timeout(5000)).close();
setupMountPointMocks();
- doReturn(WRITE).when(mockDataObjModification).getModificationType();
- doReturn(null).when(mockDataObjModification).getDataBefore();
- doReturn(node).when(mockDataObjModification).getDataAfter();
+ doReturn(WRITE).when(mockDataObjModification).modificationType();
+ doReturn(null).when(mockDataObjModification).dataBefore();
+ doReturn(node).when(mockDataObjModification).dataAfter();
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointBuilder, timeout(5000)).register();
setupMountPointMocks();
- doReturn(node).when(mockDataObjModification).getDataBefore();
+ doReturn(node).when(mockDataObjModification).dataBefore();
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointReg, timeout(5000)).close();
.build())
.build();
- doReturn(SUBTREE_MODIFIED).when(mockDataObjModification).getModificationType();
- doReturn(node).when(mockDataObjModification).getDataBefore();
- doReturn(updatedNode).when(mockDataObjModification).getDataAfter();
+ doReturn(SUBTREE_MODIFIED).when(mockDataObjModification).modificationType();
+ doReturn(node).when(mockDataObjModification).dataBefore();
+ doReturn(updatedNode).when(mockDataObjModification).dataAfter();
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointReg, timeout(5000)).close();
final Node node = new NodeBuilder().setNodeId(nodeId).addAugmentation(netconfNode).build();
DataObjectModification<Node> mockDataObjModification = mock(DataObjectModification.class);
- doReturn(Iterables.getLast(nodeListPath.getPathArguments())).when(mockDataObjModification).getIdentifier();
- doReturn(WRITE).when(mockDataObjModification).getModificationType();
- doReturn(node).when(mockDataObjModification).getDataAfter();
+ doReturn(Iterables.getLast(nodeListPath.getPathArguments())).when(mockDataObjModification).step();
+ doReturn(WRITE).when(mockDataObjModification).modificationType();
+ doReturn(node).when(mockDataObjModification).dataAfter();
// First try the registration where the perceived master hasn't been initialized as the master.
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
verify(mockMountPointBuilder, after(1000).never()).register();
yangTextSchemaSourceRequestFuture);
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
yangTextSchemaSourceRequestFuture.get(5, TimeUnit.SECONDS);
askForMasterMountPointFuture);
netconfNodeManager.onDataTreeChanged(List.of(
- new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.create(
+ new NetconfTopologyManagerTest.CustomTreeModification(DataTreeIdentifier.of(
LogicalDatastoreType.OPERATIONAL, nodeListPath), mockDataObjModification)));
askForMasterMountPointFuture.get(5, TimeUnit.SECONDS);