Bump mdsal to 5.0.2
[netconf.git] / netconf / netconf-topology-singleton / src / test / java / org / opendaylight / netconf / topology / singleton / impl / MountPointEndToEndTest.java
index b19a2cca2079ba04b035217c198ff925a06d1253..f626164bf423baa3cb1e3cd9caef4319e4392fee 100644 (file)
@@ -14,7 +14,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
@@ -26,10 +26,9 @@ import static org.mockito.MockitoAnnotations.initMocks;
 import akka.actor.ActorSystem;
 import akka.testkit.javadsl.TestKit;
 import akka.util.Timeout;
-import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -44,6 +43,8 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -56,43 +57,45 @@ import org.opendaylight.aaa.encrypt.AAAEncryptionService;
 import org.opendaylight.controller.cluster.ActorSystemProvider;
 import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
 import org.opendaylight.controller.config.threadpool.ThreadPool;
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementation;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.api.DOMService;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter;
-import org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl;
-import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataObjectModification;
+import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataTreeModification;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.api.Transaction;
+import org.opendaylight.mdsal.binding.api.TransactionChain;
+import org.opendaylight.mdsal.binding.api.TransactionChainListener;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
+import org.opendaylight.mdsal.dom.api.DOMActionService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMMountPoint;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.api.DOMService;
+import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
+import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
+import org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult;
 import org.opendaylight.mdsal.eos.dom.simple.SimpleDOMEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
 import org.opendaylight.mdsal.singleton.dom.impl.DOMClusterSingletonServiceProviderImpl;
 import org.opendaylight.netconf.client.NetconfClientDispatcher;
+import org.opendaylight.netconf.sal.connect.api.DeviceActionFactory;
 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
 import org.opendaylight.netconf.topology.singleton.impl.utils.ClusteringRpcException;
 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup;
@@ -121,13 +124,15 @@ 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.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.rcf8528.data.util.EmptyMountPointContext;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -151,7 +156,7 @@ import org.slf4j.LoggerFactory;
  * @author Thomas Pantelis
  */
 public class MountPointEndToEndTest {
-    private static Logger LOG = LoggerFactory.getLogger(MountPointEndToEndTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MountPointEndToEndTest.class);
 
     private static final String TOP_MODULE_NAME = "opendaylight-mdsal-list-test";
     private static final String ACTOR_SYSTEM_NAME = "test";
@@ -160,14 +165,16 @@ public class MountPointEndToEndTest {
     private static final InstanceIdentifier<Node> NODE_INSTANCE_ID = NetconfTopologyUtils.createTopologyNodeListPath(
             new NodeKey(NODE_ID), TOPOLOGY_ID);
 
-    @Mock private RpcProviderRegistry mockRpcProviderRegistry;
+    @Mock private DOMRpcProviderService mockRpcProviderRegistry;
+    @Mock private DOMActionProviderService mockActionProviderRegistry;
     @Mock private NetconfClientDispatcher mockClientDispatcher;
     @Mock private AAAEncryptionService mockEncryptionService;
     @Mock private ThreadPool mockThreadPool;
     @Mock private ScheduledThreadPool mockKeepaliveExecutor;
+    @Mock private DeviceActionFactory deviceActionFactory;
 
     @Mock private ActorSystemProvider mockMasterActorSystemProvider;
-    @Mock private MountProvisionListener masterMountPointListener;
+    @Mock private DOMMountPointListener masterMountPointListener;
     private final DOMMountPointService masterMountPointService = new DOMMountPointServiceImpl();
     private final DOMRpcRouter deviceRpcService = new DOMRpcRouter();
     private DOMClusterSingletonServiceProviderImpl masterClusterSingletonServiceProvider;
@@ -180,13 +187,13 @@ public class MountPointEndToEndTest {
     @Mock private ActorSystemProvider mockSlaveActorSystemProvider;
     @Mock private ClusterSingletonServiceProvider mockSlaveClusterSingletonServiceProvider;
     @Mock private ClusterSingletonServiceRegistration mockSlaveClusterSingletonServiceReg;
-    @Mock private MountProvisionListener slaveMountPointListener;
+    @Mock private DOMMountPointListener slaveMountPointListener;
     private final DOMMountPointService slaveMountPointService = new DOMMountPointServiceImpl();
     private DataBroker slaveDataBroker;
     private ActorSystem slaveSystem;
     private NetconfTopologyManager slaveNetconfTopologyManager;
     private final SettableFuture<NetconfTopologyContext> slaveNetconfTopologyContextFuture = SettableFuture.create();
-    private BindingTransactionChain slaveTxChain;
+    private TransactionChain slaveTxChain;
 
     private final EventExecutor eventExecutor = GlobalEventExecutor.INSTANCE;
     private final Config config = new ConfigBuilder().setWriteTransactionIdleTimeout(0).build();
@@ -194,7 +201,7 @@ public class MountPointEndToEndTest {
     private YangModuleInfo topModuleInfo;
     private SchemaPath putTopRpcSchemaPath;
     private SchemaPath getTopRpcSchemaPath;
-    private BindingToNormalizedNodeCodec bindingToNormalized;
+    private BindingNormalizedNodeSerializer bindingToNormalized;
     private YangInstanceIdentifier yangNodeInstanceId;
     private final TopDOMRpcImplementation topRpcImplementation = new TopDOMRpcImplementation();
 
@@ -216,7 +223,7 @@ public class MountPointEndToEndTest {
         putTopRpcSchemaPath = findRpcDefinition("put-top").getPath();
         getTopRpcSchemaPath = findRpcDefinition("get-top").getPath();
 
-        deviceRpcService.registerRpcImplementation(topRpcImplementation,
+        deviceRpcService.getRpcProviderService().registerRpcImplementation(topRpcImplementation,
                 DOMRpcIdentifier.create(putTopRpcSchemaPath), DOMRpcIdentifier.create(getTopRpcSchemaPath));
 
         setupMaster();
@@ -231,15 +238,15 @@ public class MountPointEndToEndTest {
         LOG.info("****** Setup complete");
     }
 
-    private void deleteCacheDir() {
+    private static void deleteCacheDir() {
         FileUtils.deleteQuietly(new File(NetconfTopologyUtils.CACHE_DIRECTORY));
     }
 
     @After
     public void tearDown() throws Exception {
         deleteCacheDir();
-        TestKit.shutdownActorSystem(slaveSystem, Boolean.TRUE);
-        TestKit.shutdownActorSystem(masterSystem, Boolean.TRUE);
+        TestKit.shutdownActorSystem(slaveSystem, true);
+        TestKit.shutdownActorSystem(masterSystem, true);
     }
 
     private void setupMaster() throws Exception {
@@ -265,14 +272,16 @@ public class MountPointEndToEndTest {
                     topModuleInfo.getName().getRevision()), YangTextSchemaSource.class, 1));
 
         masterNetconfTopologyManager = new NetconfTopologyManager(masterDataBroker, mockRpcProviderRegistry,
-                masterClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool,
+            mockActionProviderRegistry, masterClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool,
                 mockMasterActorSystemProvider, eventExecutor, mockClientDispatcher, TOPOLOGY_ID, config,
-                masterMountPointService, mockEncryptionService) {
+                masterMountPointService, mockEncryptionService, deviceActionFactory) {
             @Override
-            protected NetconfTopologyContext newNetconfTopologyContext(NetconfTopologySetup setup,
-                    ServiceGroupIdentifier serviceGroupIdent, Timeout actorResponseWaitTime) {
+            protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup,
+                final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime,
+                final DeviceActionFactory deviceActionFact) {
                 NetconfTopologyContext context =
-                        super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime);
+                    super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime, deviceActionFact);
+
                 NetconfTopologyContext spiedContext = spy(context);
                 doAnswer(invocation -> {
                     final MasterSalFacade spiedFacade = (MasterSalFacade) spy(invocation.callRealMethod());
@@ -302,14 +311,16 @@ public class MountPointEndToEndTest {
                 .registerClusterSingletonService(any());
 
         slaveNetconfTopologyManager = new NetconfTopologyManager(slaveDataBroker, mockRpcProviderRegistry,
-                mockSlaveClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool,
+            mockActionProviderRegistry, mockSlaveClusterSingletonServiceProvider, mockKeepaliveExecutor, mockThreadPool,
                 mockSlaveActorSystemProvider, eventExecutor, mockClientDispatcher, TOPOLOGY_ID, config,
-                slaveMountPointService, mockEncryptionService {
+                slaveMountPointService, mockEncryptionService, deviceActionFactory) {
             @Override
-            protected NetconfTopologyContext newNetconfTopologyContext(NetconfTopologySetup setup,
-                    ServiceGroupIdentifier serviceGroupIdent, Timeout actorResponseWaitTime) {
-                NetconfTopologyContext spiedContext =
-                        spy(super.newNetconfTopologyContext(setup, serviceGroupIdent, actorResponseWaitTime));
+            protected NetconfTopologyContext newNetconfTopologyContext(final NetconfTopologySetup setup,
+                final ServiceGroupIdentifier serviceGroupIdent, final Timeout actorResponseWaitTime,
+                final DeviceActionFactory actionFactory) {
+                NetconfTopologyContext spiedContext = spy(super.newNetconfTopologyContext(setup, serviceGroupIdent,
+                    actorResponseWaitTime, actionFactory));
+
                 slaveNetconfTopologyContextFuture.set(spiedContext);
                 return spiedContext;
             }
@@ -321,12 +332,12 @@ public class MountPointEndToEndTest {
 
         slaveTxChain = slaveDataBroker.createTransactionChain(new TransactionChainListener() {
             @Override
-            public void onTransactionChainSuccessful(TransactionChain<?, ?> chain) {
+            public void onTransactionChainSuccessful(final TransactionChain chain) {
             }
 
             @Override
-            public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
-                    Throwable cause) {
+            public void onTransactionChainFailed(final TransactionChain chain, final Transaction transaction,
+                    final Throwable cause) {
                 LOG.error("Slave transaction chain failed", cause);
             }
         });
@@ -352,8 +363,8 @@ public class MountPointEndToEndTest {
 
         final MasterSalFacade masterSalFacade = masterSalFacadeFuture.get(5, TimeUnit.SECONDS);
 
-        masterSalFacade.onDeviceConnected(deviceSchemaContext,
-                NetconfSessionPreferences.fromStrings(Collections.emptyList()), deviceRpcService);
+        masterSalFacade.onDeviceConnected(new EmptyMountPointContext(deviceSchemaContext),
+                NetconfSessionPreferences.fromStrings(Collections.emptyList()), deviceRpcService.getRpcService());
 
         DOMMountPoint masterMountPoint = awaitMountPoint(masterMountPointService);
 
@@ -378,7 +389,7 @@ public class MountPointEndToEndTest {
         // This is essentially what happens in a clustered environment but we'll use a DTCL here.
 
         masterDataBroker.registerDataTreeChangeListener(
-            new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, NODE_INSTANCE_ID), changes -> {
+            DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, NODE_INSTANCE_ID), changes -> {
                 final WriteTransaction slaveTx = slaveTxChain.newWriteOnlyTransaction();
                 for (DataTreeModification<Node> dataTreeModification : changes) {
                     DataObjectModification<Node> rootNode = dataTreeModification.getRootNode();
@@ -427,8 +438,8 @@ public class MountPointEndToEndTest {
 
         MasterSalFacade masterSalFacade = masterSalFacadeFuture.get(5, TimeUnit.SECONDS);
 
-        masterSalFacade.onDeviceConnected(deviceSchemaContext,
-                NetconfSessionPreferences.fromStrings(Collections.emptyList()), deviceRpcService);
+        masterSalFacade.onDeviceConnected(new EmptyMountPointContext(deviceSchemaContext),
+                NetconfSessionPreferences.fromStrings(Collections.emptyList()), deviceRpcService.getRpcService());
 
         verify(masterMountPointListener, timeout(5000)).onMountPointCreated(yangNodeInstanceId);
 
@@ -447,11 +458,11 @@ public class MountPointEndToEndTest {
         awaitMountPointNotPresent(masterMountPointService);
 
         await().atMost(5, TimeUnit.SECONDS).until(() -> {
-            try (ReadOnlyTransaction readTx = masterDataBroker.newReadOnlyTransaction()) {
+            try (ReadTransaction readTx = masterDataBroker.newReadOnlyTransaction()) {
                 Optional<Node> node = readTx.read(LogicalDatastoreType.OPERATIONAL,
                         NODE_INSTANCE_ID).get(5, TimeUnit.SECONDS);
                 assertTrue(node.isPresent());
-                final NetconfNode netconfNode = node.get().getAugmentation(NetconfNode.class);
+                final NetconfNode netconfNode = node.get().augmentation(NetconfNode.class);
                 return netconfNode.getConnectionStatus() != NetconfNodeConnectionStatus.ConnectionStatus.Connected;
             }
         });
@@ -466,7 +477,7 @@ public class MountPointEndToEndTest {
         verify(mockSlaveClusterSingletonServiceReg).close();
     }
 
-    private void testDOMRpcService(DOMRpcService domRpcService)
+    private void testDOMRpcService(final DOMRpcService domRpcService)
             throws InterruptedException, ExecutionException, TimeoutException {
         testPutTopRpc(domRpcService, new DefaultDOMRpcResult((NormalizedNode<?, ?>)null));
         testPutTopRpc(domRpcService, null);
@@ -481,7 +492,7 @@ public class MountPointEndToEndTest {
         testFailedRpc(domRpcService, getTopRpcSchemaPath, null);
     }
 
-    private void testPutTopRpc(DOMRpcService domRpcService, DOMRpcResult result)
+    private void testPutTopRpc(final DOMRpcService domRpcService, final DOMRpcResult result)
             throws InterruptedException, ExecutionException, TimeoutException {
         ContainerNode putTopInput = bindingToNormalized.toNormalizedNodeRpcData(
                 new PutTopInputBuilder().setTopLevelList(Arrays.asList(new TopLevelListBuilder().setName("one")
@@ -489,14 +500,17 @@ public class MountPointEndToEndTest {
         testRpc(domRpcService, putTopRpcSchemaPath, putTopInput, result);
     }
 
-    private void testGetTopRpc(DOMRpcService domRpcService, DOMRpcResult result)
+    private void testGetTopRpc(final DOMRpcService domRpcService, final DOMRpcResult result)
             throws InterruptedException, ExecutionException, TimeoutException {
         testRpc(domRpcService, getTopRpcSchemaPath, null, result);
     }
 
-    private void testRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input,
-            DOMRpcResult result) throws InterruptedException, ExecutionException, TimeoutException {
-        final DOMRpcResult actual = invokeRpc(domRpcService, schemaPath, input, Futures.immediateCheckedFuture(result));
+    private void testRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input, final DOMRpcResult result) throws InterruptedException,
+            ExecutionException, TimeoutException {
+        final FluentFuture<DOMRpcResult> future = result == null ? FluentFutures.immediateNullFluentFuture()
+                : FluentFutures.immediateFluentFuture(result);
+        final DOMRpcResult actual = invokeRpc(domRpcService, schemaPath, input, future);
         if (result == null) {
             assertNull(actual);
             return;
@@ -506,8 +520,8 @@ public class MountPointEndToEndTest {
         assertEquals(result.getResult(), actual.getResult());
 
         assertEquals(result.getErrors().size(), actual.getErrors().size());
-        Iterator<RpcError> iter1 = result.getErrors().iterator();
-        Iterator<RpcError> iter2 = actual.getErrors().iterator();
+        Iterator<? extends RpcError> iter1 = result.getErrors().iterator();
+        Iterator<? extends RpcError> iter2 = actual.getErrors().iterator();
         while (iter1.hasNext() && iter2.hasNext()) {
             RpcError err1 = iter1.next();
             RpcError err2 = iter2.next();
@@ -520,10 +534,10 @@ public class MountPointEndToEndTest {
         }
     }
 
-    private void testFailedRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input)
-            throws InterruptedException, TimeoutException  {
+    private void testFailedRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input) throws InterruptedException, TimeoutException {
         try {
-            invokeRpc(domRpcService, schemaPath, input, Futures.immediateFailedCheckedFuture(
+            invokeRpc(domRpcService, schemaPath, input, FluentFutures.immediateFailedFluentFuture(
                     new ClusteringRpcException("mock")));
             fail("Expected exception");
         } catch (ExecutionException e) {
@@ -532,8 +546,8 @@ public class MountPointEndToEndTest {
         }
     }
 
-    private DOMRpcResult invokeRpc(DOMRpcService domRpcService, SchemaPath schemaPath, NormalizedNode<?, ?> input,
-            CheckedFuture<DOMRpcResult, DOMRpcException> returnFuture)
+    private DOMRpcResult invokeRpc(final DOMRpcService domRpcService, final SchemaPath schemaPath,
+            final NormalizedNode<?, ?> input, final FluentFuture<DOMRpcResult> returnFuture)
                     throws InterruptedException, ExecutionException, TimeoutException {
         topRpcImplementation.init(returnFuture);
         final ListenableFuture<DOMRpcResult> resultFuture = domRpcService.invokeRpc(schemaPath, input);
@@ -543,10 +557,10 @@ public class MountPointEndToEndTest {
         return resultFuture.get(5, TimeUnit.SECONDS);
     }
 
-    private static void testDOMDataBrokerOperations(DOMDataBroker dataBroker)
+    private static void testDOMDataBrokerOperations(final DOMDataBroker dataBroker)
             throws InterruptedException, ExecutionException, TimeoutException {
 
-        DOMDataWriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
+        DOMDataTreeWriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
 
         final ContainerNode topNode = Builders.containerBuilder()
                 .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(Top.QNAME)).build();
@@ -568,16 +582,16 @@ public class MountPointEndToEndTest {
         writeTx.delete(LogicalDatastoreType.CONFIGURATION, topPath);
         writeTx.commit().get(5, TimeUnit.SECONDS);
 
-        DOMDataReadWriteTransaction readTx = dataBroker.newReadWriteTransaction();
+        DOMDataTreeReadWriteTransaction readTx = dataBroker.newReadWriteTransaction();
         assertFalse(readTx.exists(LogicalDatastoreType.CONFIGURATION, topPath).get(5, TimeUnit.SECONDS));
         assertTrue(readTx.cancel());
     }
 
-    private static void writeNetconfNode(String cacheDir, DataBroker databroker)
+    private static void writeNetconfNode(final String cacheDir, final DataBroker databroker)
             throws InterruptedException, ExecutionException, TimeoutException {
         final NetconfNode netconfNode = new NetconfNodeBuilder()
                 .setHost(new Host(new IpAddress(new Ipv4Address("127.0.0.1"))))
-                .setPort(new PortNumber(1234))
+                .setPort(new PortNumber(Uint16.valueOf(1234)))
                 .setActorResponseWaitTime(10)
                 .setTcpOnly(Boolean.TRUE)
                 .setSchemaless(Boolean.FALSE)
@@ -596,8 +610,8 @@ public class MountPointEndToEndTest {
         writeTx.commit().get(5, TimeUnit.SECONDS);
     }
 
-    private static void verifyDataInStore(DOMDataReadTransaction readTx, YangInstanceIdentifier path,
-            NormalizedNode<?, ?> expNode) throws InterruptedException, ExecutionException, TimeoutException {
+    private static void verifyDataInStore(final DOMDataTreeReadOperations readTx, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> expNode) throws InterruptedException, ExecutionException, TimeoutException {
         final Optional<NormalizedNode<?, ?>> read = readTx.read(LogicalDatastoreType.CONFIGURATION, path)
                 .get(5, TimeUnit.SECONDS);
         assertTrue(read.isPresent());
@@ -607,9 +621,9 @@ public class MountPointEndToEndTest {
         assertTrue(exists);
     }
 
-    private static void verifyTopologyNodesCreated(DataBroker dataBroker) {
+    private static void verifyTopologyNodesCreated(final DataBroker dataBroker) {
         await().atMost(5, TimeUnit.SECONDS).until(() -> {
-            try (ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
+            try (ReadTransaction readTx = dataBroker.newReadOnlyTransaction()) {
                 Optional<Topology> configTopology = readTx.read(LogicalDatastoreType.CONFIGURATION,
                         NetconfTopologyUtils.createTopologyListPath(TOPOLOGY_ID)).get(3, TimeUnit.SECONDS);
                 Optional<Topology> operTopology = readTx.read(LogicalDatastoreType.OPERATIONAL,
@@ -622,7 +636,7 @@ public class MountPointEndToEndTest {
     private AbstractConcurrentDataBrokerTest newDataBrokerTest() throws Exception {
         AbstractConcurrentDataBrokerTest dataBrokerTest = new AbstractConcurrentDataBrokerTest(true) {
             @Override
-            protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
+            protected Set<YangModuleInfo> getModuleInfos() throws Exception {
                 return ImmutableSet.of(BindingReflections.getModuleInfo(NetconfNode.class),
                         BindingReflections.getModuleInfo(NetworkTopology.class),
                         BindingReflections.getModuleInfo(Topology.class),
@@ -635,34 +649,38 @@ public class MountPointEndToEndTest {
         return dataBrokerTest;
     }
 
-    private void awaitMountPointNotPresent(DOMMountPointService mountPointService) {
+    private void awaitMountPointNotPresent(final DOMMountPointService mountPointService) {
         await().atMost(5, TimeUnit.SECONDS).until(
             () -> !mountPointService.getMountPoint(yangNodeInstanceId).isPresent());
     }
 
-    private static DOMDataBroker getDOMDataBroker(DOMMountPoint mountPoint) {
+    private static DOMDataBroker getDOMDataBroker(final DOMMountPoint mountPoint) {
         return getMountPointService(mountPoint, DOMDataBroker.class);
     }
 
-    private static DOMRpcService getDOMRpcService(DOMMountPoint mountPoint) {
+    private static DOMRpcService getDOMRpcService(final DOMMountPoint mountPoint) {
         return getMountPointService(mountPoint, DOMRpcService.class);
     }
 
-    private static <T extends DOMService> T getMountPointService(DOMMountPoint mountPoint, Class<T> serviceClass) {
+    private static DOMActionService getDomActionService(final DOMMountPoint mountPoint) {
+        return getMountPointService(mountPoint, DOMActionService.class);
+    }
+
+    private static <T extends DOMService> T getMountPointService(final DOMMountPoint mountPoint,
+            final Class<T> serviceClass) {
         final Optional<T> maybeService = mountPoint.getService(serviceClass);
         assertTrue(maybeService.isPresent());
         return maybeService.get();
     }
 
-    private DOMMountPoint awaitMountPoint(DOMMountPointService mountPointService) {
-        await().atMost(5, TimeUnit.SECONDS).until(() -> {
-            return mountPointService.getMountPoint(yangNodeInstanceId).isPresent();
-        });
+    private DOMMountPoint awaitMountPoint(final DOMMountPointService mountPointService) {
+        await().atMost(5, TimeUnit.SECONDS).until(() ->
+                mountPointService.getMountPoint(yangNodeInstanceId).isPresent());
 
         return mountPointService.getMountPoint(yangNodeInstanceId).get();
     }
 
-    private RpcDefinition findRpcDefinition(String rpc) {
+    private RpcDefinition findRpcDefinition(final String rpc) {
         Module topModule = deviceSchemaContext.findModule(TOP_MODULE_NAME, topModuleInfo.getName().getRevision()).get();
         RpcDefinition rpcDefinition = null;
         for (RpcDefinition def: topModule.getRpcs()) {
@@ -678,21 +696,21 @@ public class MountPointEndToEndTest {
 
     private static class TopDOMRpcImplementation implements DOMRpcImplementation {
         private volatile SettableFuture<Entry<DOMRpcIdentifier, NormalizedNode<?, ?>>> rpcInvokedFuture;
-        private volatile CheckedFuture<DOMRpcResult, DOMRpcException> returnFuture;
+        private volatile FluentFuture<DOMRpcResult> returnFuture;
 
         @Override
-        public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(DOMRpcIdentifier rpc,
-                NormalizedNode<?, ?> input) {
+        public FluentFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc,
+                final NormalizedNode<?, ?> input) {
             rpcInvokedFuture.set(new SimpleEntry<>(rpc, input));
             return returnFuture;
         }
 
-        void init(CheckedFuture<DOMRpcResult, DOMRpcException> retFuture) {
+        void init(final FluentFuture<DOMRpcResult> retFuture) {
             this.returnFuture = retFuture;
             rpcInvokedFuture = SettableFuture.create();
         }
 
-        void verify(DOMRpcIdentifier expRpc, NormalizedNode<?, ?> expInput)
+        void verify(final DOMRpcIdentifier expRpc, final NormalizedNode<?, ?> expInput)
                 throws InterruptedException, ExecutionException, TimeoutException {
             final Entry<DOMRpcIdentifier, NormalizedNode<?, ?>> actual = rpcInvokedFuture.get(5, TimeUnit.SECONDS);
             assertEquals(expRpc, actual.getKey());