Split out odl-netconf-device.yang
[netconf.git] / netconf / netconf-topology-singleton / src / test / java / org / opendaylight / netconf / topology / singleton / impl / MountPointEndToEndTest.java
index 725260874ea81e86184ecf91e6fcd4df9e50e7c4..c6de36f416d28254404825f412b9abd34b82cc27 100644 (file)
@@ -115,13 +115,13 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.ConnectionOper.ConnectionStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.LoginPwUnencryptedBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.keystore.rev171017.Keystore;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPwUnencryptedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.network.topology.topology.topology.types.TopologyNetconf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.ConfigBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.GetTopInput;
@@ -256,7 +256,7 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
         final var rpcService = router.getRpcService();
         deviceRpcService = new Rpcs.Normalized() {
             @Override
-            public ListenableFuture<? extends DOMRpcResult> invokeRpc(final QName type, final NormalizedNode input) {
+            public ListenableFuture<? extends DOMRpcResult> invokeRpc(final QName type, final ContainerNode input) {
                 return rpcService.invokeRpc(type, input);
             }
 
@@ -509,7 +509,7 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
                         NODE_INSTANCE_ID).get(5, TimeUnit.SECONDS);
                 assertTrue(node.isPresent());
                 final NetconfNode netconfNode = node.get().augmentation(NetconfNode.class);
-                return netconfNode.getConnectionStatus() != NetconfNodeConnectionStatus.ConnectionStatus.Connected;
+                return netconfNode.getConnectionStatus() != ConnectionStatus.Connected;
             }
         });
 
@@ -525,7 +525,7 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
 
     private void testDOMRpcService(final DOMRpcService domRpcService)
             throws InterruptedException, ExecutionException, TimeoutException {
-        testPutTopRpc(domRpcService, new DefaultDOMRpcResult((NormalizedNode)null));
+        testPutTopRpc(domRpcService, new DefaultDOMRpcResult((ContainerNode)null));
         testPutTopRpc(domRpcService, null);
         testPutTopRpc(domRpcService, new DefaultDOMRpcResult(ImmutableList.of(
                 RpcResultBuilder.newError(ErrorType.APPLICATION, new ErrorTag("tag1"), "error1"),
@@ -554,7 +554,7 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
         testRpc(domRpcService, getTopRpcSchemaPath, getTopInput, result);
     }
 
-    private void testRpc(final DOMRpcService domRpcService, final QName qname, final NormalizedNode input,
+    private void testRpc(final DOMRpcService domRpcService, final QName qname, final ContainerNode input,
             final DOMRpcResult result) throws InterruptedException, ExecutionException, TimeoutException {
         final FluentFuture<DOMRpcResult> future = result == null ? FluentFutures.immediateNullFluentFuture()
                 : FluentFutures.immediateFluentFuture(result);
@@ -565,11 +565,11 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
         }
 
         assertNotNull(actual);
-        assertEquals(result.getResult(), actual.getResult());
+        assertEquals(result.value(), actual.value());
 
-        assertEquals(result.getErrors().size(), actual.getErrors().size());
-        Iterator<? extends RpcError> iter1 = result.getErrors().iterator();
-        Iterator<? extends RpcError> iter2 = actual.getErrors().iterator();
+        assertEquals(result.errors().size(), actual.errors().size());
+        Iterator<? extends RpcError> iter1 = result.errors().iterator();
+        Iterator<? extends RpcError> iter2 = actual.errors().iterator();
         while (iter1.hasNext() && iter2.hasNext()) {
             RpcError err1 = iter1.next();
             RpcError err2 = iter2.next();
@@ -582,11 +582,10 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
         }
     }
 
-    private void testFailedRpc(final DOMRpcService domRpcService, final QName qname, final NormalizedNode input)
+    private void testFailedRpc(final DOMRpcService domRpcService, final QName qname, final ContainerNode input)
             throws InterruptedException, TimeoutException {
         try {
-            invokeRpc(domRpcService, qname, input, FluentFutures.immediateFailedFluentFuture(
-                    new ClusteringRpcException("mock")));
+            invokeRpc(domRpcService, qname, input, Futures.immediateFailedFuture(new ClusteringRpcException("mock")));
             fail("Expected exception");
         } catch (ExecutionException e) {
             assertTrue(e.getCause() instanceof ClusteringRpcException);
@@ -594,8 +593,8 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
         }
     }
 
-    private DOMRpcResult invokeRpc(final DOMRpcService domRpcService, final QName qname, final NormalizedNode input,
-            final FluentFuture<DOMRpcResult> returnFuture)
+    private DOMRpcResult invokeRpc(final DOMRpcService domRpcService, final QName qname, final ContainerNode input,
+            final ListenableFuture<DOMRpcResult> returnFuture)
                 throws InterruptedException, ExecutionException, TimeoutException {
         topRpcImplementation.init(returnFuture);
         final ListenableFuture<? extends DOMRpcResult> resultFuture = domRpcService.invokeRpc(qname, input);
@@ -749,15 +748,15 @@ public class MountPointEndToEndTest extends AbstractBaseSchemasTest {
 
     private static class TopDOMRpcImplementation implements DOMRpcImplementation {
         private volatile SettableFuture<Entry<DOMRpcIdentifier, NormalizedNode>> rpcInvokedFuture;
-        private volatile FluentFuture<DOMRpcResult> returnFuture;
+        private volatile ListenableFuture<DOMRpcResult> returnFuture;
 
         @Override
-        public FluentFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode input) {
+        public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) {
             rpcInvokedFuture.set(Map.entry(rpc, input));
             return returnFuture;
         }
 
-        void init(final FluentFuture<DOMRpcResult> retFuture) {
+        void init(final ListenableFuture<DOMRpcResult> retFuture) {
             returnFuture = retFuture;
             rpcInvokedFuture = SettableFuture.create();
         }