2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netconf.topology.singleton.impl;
11 import static org.mockito.Matchers.any;
12 import static org.mockito.Mockito.doReturn;
14 import akka.actor.ActorRef;
15 import akka.util.Timeout;
16 import com.google.common.util.concurrent.Futures;
17 import org.opendaylight.netconf.sal.connect.api.RemoteDeviceHandler;
18 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator;
19 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
20 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfConnectorDTO;
21 import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologySetup;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
23 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
25 class TestingRemoteDeviceConnectorImpl extends RemoteDeviceConnectorImpl {
27 private final NetconfDeviceCommunicator communicator;
28 private final RemoteDeviceHandler salFacade;
30 TestingRemoteDeviceConnectorImpl(final NetconfTopologySetup netconfTopologyDeviceSetup,
31 final RemoteDeviceId remoteDeviceId,
32 final NetconfDeviceCommunicator communicator,
33 final RemoteDeviceHandler salFacade,
34 final Timeout actorResponseWaitTime) {
35 super(netconfTopologyDeviceSetup, remoteDeviceId, actorResponseWaitTime);
36 this.communicator = communicator;
37 this.salFacade = salFacade;
41 public NetconfConnectorDTO createDeviceCommunicator(final NodeId nodeId, final NetconfNode node,
42 final ActorRef deviceContextActorRef) {
43 final NetconfConnectorDTO connectorDTO = new NetconfConnectorDTO(communicator, salFacade);
44 doReturn(Futures.immediateCheckedFuture(null)).when(communicator).initializeRemoteConnection(any(), any());