Bug 8032 - Initialization in sal failed, disconnecting from device
[netconf.git] / netconf / netconf-topology-singleton / src / test / java / org / opendaylight / netconf / topology / singleton / impl / NetconfTopologyManagerTest.java
index 9a3749c14e4e59dc225a25d581150e105c45c9d5..ffc52a5f4663184c2d9f01e575f378a9af9b4ba2 100644 (file)
@@ -40,9 +40,8 @@ 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.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.Broker;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.netconf.client.NetconfClientDispatcher;
@@ -53,6 +52,8 @@ 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.PortNumber;
 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.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.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 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;
@@ -76,18 +77,19 @@ public class NetconfTopologyManagerTest {
         initMocks(this);
 
         final RpcProviderRegistry rpcProviderRegistry = mock(RpcProviderRegistry.class);
-        final BindingAwareBroker bindingAwareBroker = mock(BindingAwareBroker.class);
         final ScheduledThreadPool keepaliveExecutor = mock(ScheduledThreadPool.class);
         final ThreadPool processingExecutor = mock(ThreadPool.class);
-        final Broker domBroker = mock(Broker.class);
         final ActorSystemProvider actorSystemProvider = mock(ActorSystemProvider.class);
         final EventExecutor eventExecutor = mock(EventExecutor.class);
         final NetconfClientDispatcher clientDispatcher = mock(NetconfClientDispatcher.class);
+        final DOMMountPointService mountPointService = mock(DOMMountPointService.class);
 
+        final Config config = new ConfigBuilder().setWriteTransactionIdleTimeout(0).build();
         netconfTopologyManager = new NetconfTopologyManager(dataBroker, rpcProviderRegistry,
-                clusterSingletonServiceProvider, bindingAwareBroker, keepaliveExecutor, processingExecutor, domBroker,
-                actorSystemProvider, eventExecutor, clientDispatcher, topologyId);
+                clusterSingletonServiceProvider, keepaliveExecutor, processingExecutor,
+                actorSystemProvider, eventExecutor, clientDispatcher, topologyId, config, mountPointService);
     }
+
     @Test
     public void testWriteConfiguration() throws Exception {
 
@@ -131,6 +133,7 @@ public class NetconfTopologyManagerTest {
                 .setBetweenAttemptsTimeoutMillis(100)
                 .setSchemaless(false)
                 .setTcpOnly(false)
+                .setActorResponseWaitTime(10)
                 .build();
         final Node node = new NodeBuilder().setNodeId(new NodeId("node-id"))
                 .addAugmentation(NetconfNode.class, netconfNode).build();
@@ -251,7 +254,7 @@ public class NetconfTopologyManagerTest {
         private final DataTreeIdentifier<Node> rootPath;
         private final DataObjectModification<Node> rootNode;
 
-        CustomTreeModification(DataTreeIdentifier<Node> rootPath, DataObjectModification<Node> rootNode) {
+        CustomTreeModification(final DataTreeIdentifier<Node> rootPath, final DataObjectModification<Node> rootNode) {
             this.rootPath = rootPath;
             this.rootNode = rootNode;
         }