From ba253bbefed3bf18a37f6c04fa989237574f0956 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20de=20Talhou=C3=ABt?= Date: Fri, 21 Oct 2016 17:22:53 -0400 Subject: [PATCH] Add logging in tx facade along with the RemoteDeviceId MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I0e30376d65ff734ff3dc34809554b961a013a15b Signed-off-by: Alexis de Talhouët --- .../singleton/impl/NetconfDOMDataBroker.java | 8 ++-- .../singleton/impl/SlaveSalFacade.java | 2 +- .../impl/tx/NetconfMasterDOMTransaction.java | 36 ++++++++++++--- .../impl/tx/NetconfProxyDOMTransaction.java | 45 ++++++++++++++----- .../impl/tx/NetconfReadOnlyTransaction.java | 17 ++++++- .../impl/tx/NetconfWriteOnlyTransaction.java | 23 +++++++++- .../impl/tx/ReadOnlyTransactionTest.java | 4 +- .../impl/tx/WriteOnlyTransactionTest.java | 5 ++- 8 files changed, 111 insertions(+), 29 deletions(-) diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfDOMDataBroker.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfDOMDataBroker.java index 99ddc7fa30..4fadb08ee4 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfDOMDataBroker.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfDOMDataBroker.java @@ -44,18 +44,18 @@ public class NetconfDOMDataBroker implements DOMDataBroker { @Override public DOMDataReadOnlyTransaction newReadOnlyTransaction() { - return new NetconfReadOnlyTransaction(actorSystem, masterDataBroker); + return new NetconfReadOnlyTransaction(id, actorSystem, masterDataBroker); } @Override public DOMDataReadWriteTransaction newReadWriteTransaction() { - return new ReadWriteTx(new NetconfReadOnlyTransaction(actorSystem, masterDataBroker), - new NetconfWriteOnlyTransaction(actorSystem, masterDataBroker)); + return new ReadWriteTx(new NetconfReadOnlyTransaction(id, actorSystem, masterDataBroker), + new NetconfWriteOnlyTransaction(id, actorSystem, masterDataBroker)); } @Override public DOMDataWriteTransaction newWriteOnlyTransaction() { - return new NetconfWriteOnlyTransaction(actorSystem, masterDataBroker); + return new NetconfWriteOnlyTransaction(id, actorSystem, masterDataBroker); } @Override diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java index 772020bcaa..877436d6cc 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/SlaveSalFacade.java @@ -50,7 +50,7 @@ public class SlaveSalFacade { final NetconfDeviceNotificationService notificationService = new NetconfDeviceNotificationService(); final NetconfDOMTransaction proxyDOMTransactions = - new NetconfProxyDOMTransaction(actorSystem, masterActorRef); + new NetconfProxyDOMTransaction(id, actorSystem, masterActorRef); final NetconfDOMDataBroker netconfDeviceDataBroker = new NetconfDOMDataBroker(actorSystem, id, proxyDOMTransactions); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java index 602eb75503..33680f2dfc 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfMasterDOMTransaction.java @@ -28,27 +28,30 @@ import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessag import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import scala.concurrent.Future; import scala.concurrent.impl.Promise.DefaultPromise; public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { + private static final Logger LOG = LoggerFactory.getLogger(NetconfMasterDOMTransaction.class); + + private final RemoteDeviceId id; private final DOMDataBroker delegateBroker; private DOMDataReadOnlyTransaction readTx; private DOMDataWriteTransaction writeTx; public NetconfMasterDOMTransaction(final RemoteDeviceId id, - final SchemaContext schemaContext, final DOMRpcService rpc, + final SchemaContext schemaContext, + final DOMRpcService rpc, final NetconfSessionPreferences netconfSessionPreferences) { - - delegateBroker = new NetconfDeviceDataBroker(id, schemaContext, rpc, netconfSessionPreferences); - - // only ever need 1 readTx since it doesnt need to be closed - readTx = delegateBroker.newReadOnlyTransaction(); + this(id, new NetconfDeviceDataBroker(id, schemaContext, rpc, netconfSessionPreferences)); } - public NetconfMasterDOMTransaction(final DOMDataBroker delegateBroker) { + public NetconfMasterDOMTransaction(final RemoteDeviceId id, final DOMDataBroker delegateBroker) { + this.id = id; this.delegateBroker = delegateBroker; // only ever need 1 readTx since it doesnt need to be closed @@ -58,6 +61,8 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { @Override public Future> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Read[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path); + final CheckedFuture>, ReadFailedException> readFuture = readTx.read(store, path); final DefaultPromise> promise = new DefaultPromise<>(); @@ -81,6 +86,8 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { @Override public Future exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Exists[{}] {} via NETCONF: {}", id, readTx.getIdentifier(), store, path); + final CheckedFuture existsFuture = readTx.exists(store, path); final DefaultPromise promise = new DefaultPromise<>(); @@ -103,6 +110,10 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { if (writeTx == null) { writeTx = delegateBroker.newWriteOnlyTransaction(); } + + LOG.trace("{}: Write[{}] {} via NETCONF: {} with payload {}", id, writeTx.getIdentifier(), store, + data.getIdentifier(), data.getNode()); + writeTx.put(store, data.getIdentifier(), data.getNode()); } @@ -111,6 +122,10 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { if (writeTx == null) { writeTx = delegateBroker.newWriteOnlyTransaction(); } + + LOG.trace("{}: Merge[{}] {} via NETCONF: {} with payload {}", id, writeTx.getIdentifier(),store, + data.getIdentifier(), data.getNode()); + writeTx.merge(store, data.getIdentifier(), data.getNode()); } @@ -119,16 +134,23 @@ public class NetconfMasterDOMTransaction implements NetconfDOMTransaction { if (writeTx == null) { writeTx = delegateBroker.newWriteOnlyTransaction(); } + + LOG.trace("{}: Delete[{}} {} via NETCONF: {}", id, writeTx.getIdentifier(), store, path); + writeTx.delete(store, path); } @Override public boolean cancel() { + LOG.trace("{}: Cancel[{}} via NETCONF", id, writeTx.getIdentifier()); + return writeTx.cancel(); } @Override public Future submit() { + LOG.trace("{}: Submit[{}} via NETCONF", id, writeTx.getIdentifier()); + final CheckedFuture submitFuture = writeTx.submit(); final DefaultPromise promise = new DefaultPromise<>(); Futures.addCallback(submitFuture, new FutureCallback() { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java index 7ed16e7247..e79f83adf6 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfProxyDOMTransaction.java @@ -14,7 +14,11 @@ import akka.dispatch.OnComplete; import akka.pattern.Patterns; import com.google.common.base.Optional; import org.opendaylight.controller.config.util.xml.DocumentedException; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorSeverity; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorTag; +import org.opendaylight.controller.config.util.xml.DocumentedException.ErrorType; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction; import org.opendaylight.netconf.topology.singleton.impl.utils.NetconfTopologyUtils; import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage; @@ -39,10 +43,14 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { private static final Logger LOG = LoggerFactory.getLogger(NetconfProxyDOMTransaction.class); + private final RemoteDeviceId id; private final ActorSystem actorSystem; private final ActorRef masterContextRef; - public NetconfProxyDOMTransaction(final ActorSystem actorSystem, final ActorRef masterContextRef) { + public NetconfProxyDOMTransaction(final RemoteDeviceId id, + final ActorSystem actorSystem, + final ActorRef masterContextRef) { + this.id = id; this.actorSystem = actorSystem; this.masterContextRef = masterContextRef; } @@ -54,15 +62,17 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { final Future readScalaFuture = Patterns.ask(masterContextRef, new ReadRequest(store, path), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Read {} via NETCONF: {}", id, store, path); + final DefaultPromise> promise = new DefaultPromise<>(); readScalaFuture.onComplete(new OnComplete() { @Override public void onComplete(final Throwable failure, final Object success) throws Throwable { if (failure != null) { // ask timeout - Exception exception = new DocumentedException("Master is down. Please try again.", - DocumentedException.ErrorType.application, DocumentedException.ErrorTag.operation_failed, - DocumentedException.ErrorSeverity.warning); + Exception exception = new DocumentedException(id + ":Master is down. Please try again.", + ErrorType.application, ErrorTag.operation_failed, + ErrorSeverity.warning); promise.failure(exception); return; } @@ -87,14 +97,16 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { final Future existsScalaFuture = Patterns.ask(masterContextRef, new ExistsRequest(store, path), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path); + final DefaultPromise promise = new DefaultPromise<>(); existsScalaFuture.onComplete(new OnComplete() { @Override public void onComplete(final Throwable failure, final Object success) throws Throwable { if (failure != null) { // ask timeout - Exception exception = new DocumentedException("Master is down. Please try again.", - DocumentedException.ErrorType.application, DocumentedException.ErrorTag.operation_failed, - DocumentedException.ErrorSeverity.warning); + Exception exception = new DocumentedException(id + ":Master is down. Please try again.", + ErrorType.application, ErrorTag.operation_failed, + ErrorSeverity.warning); promise.failure(exception); return; } @@ -110,17 +122,23 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { @Override public void put(final LogicalDatastoreType store, final NormalizedNodeMessage data) { + LOG.trace("{}: Write {} via NETCONF: {} with payload {}", id, store, data.getIdentifier(), data.getNode()); + masterContextRef.tell(new PutRequest(store, data), ActorRef.noSender()); } @Override public void merge(final LogicalDatastoreType store, final NormalizedNodeMessage data) { + LOG.trace("{}: Merge {} via NETCONF: {} with payload {}", id, store, data.getIdentifier(), data.getNode()); + masterContextRef.tell(new MergeRequest(store, data), ActorRef.noSender()); } @Override public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Delete {} via NETCONF: {}", id, store, path); + masterContextRef.tell(new DeleteRequest(store, path), ActorRef.noSender()); } @@ -128,6 +146,9 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { public boolean cancel() { final Future cancelScalaFuture = Patterns.ask(masterContextRef, new CancelRequest(), NetconfTopologyUtils.TIMEOUT); + + LOG.trace("{}: Cancel {} via NETCONF", id); + try { // here must be Await because AsyncWriteTransaction do not return future return (boolean) Await.result(cancelScalaFuture, NetconfTopologyUtils.TIMEOUT.duration()); @@ -141,15 +162,17 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { final Future submitScalaFuture = Patterns.ask(masterContextRef, new SubmitRequest(), NetconfTopologyUtils.TIMEOUT); + LOG.trace("{}: Submit {} via NETCONF", id); + final DefaultPromise promise = new DefaultPromise<>(); submitScalaFuture.onComplete(new OnComplete() { @Override public void onComplete(final Throwable failure, final Object success) throws Throwable { if (failure != null) { // ask timeout - Exception exception = new DocumentedException("Master is down. Please try again.", - DocumentedException.ErrorType.application, DocumentedException.ErrorTag.operation_failed, - DocumentedException.ErrorSeverity.warning); + Exception exception = new DocumentedException(id + ":Master is down. Please try again.", + ErrorType.application, ErrorTag.operation_failed, + ErrorSeverity.warning); promise.failure(exception); return; } @@ -157,7 +180,7 @@ public class NetconfProxyDOMTransaction implements NetconfDOMTransaction { promise.failure((Throwable) success); } else { if (success instanceof SubmitFailedReply) { - LOG.error("Transaction was not submitted."); + LOG.error("{}: Transaction was not submitted because already closed.", id); } promise.success(null); } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java index 3af25c62b9..9b386c0a47 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfReadOnlyTransaction.java @@ -19,18 +19,27 @@ import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction; +import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction; import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import scala.concurrent.Future; public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction { + private static final Logger LOG = LoggerFactory.getLogger(NetconfReadOnlyTransaction.class); + + private final RemoteDeviceId id; private final NetconfDOMTransaction delegate; private final ActorSystem actorSystem; - public NetconfReadOnlyTransaction(final ActorSystem actorSystem, final NetconfDOMTransaction delegate) { + public NetconfReadOnlyTransaction(final RemoteDeviceId id, + final ActorSystem actorSystem, + final NetconfDOMTransaction delegate) { + this.id = id; this.delegate = delegate; this.actorSystem = actorSystem; } @@ -43,6 +52,9 @@ public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction { @Override public CheckedFuture>, ReadFailedException> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + + LOG.trace("{}: Read {} via NETCONF: {}", id, store, path); + final Future> future = delegate.read(store, path); final SettableFuture>> settableFuture = SettableFuture.create(); final CheckedFuture>, ReadFailedException> checkedFuture; @@ -82,6 +94,9 @@ public class NetconfReadOnlyTransaction implements DOMDataReadOnlyTransaction { @Override public CheckedFuture exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + + LOG.trace("{}: Exists {} via NETCONF: {}", id, store, path); + final Future existsFuture = delegate.exists(store, path); final SettableFuture settableFuture = SettableFuture.create(); final CheckedFuture checkedFuture; diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java index bef72a256b..f938748cbf 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/tx/NetconfWriteOnlyTransaction.java @@ -20,20 +20,29 @@ import org.opendaylight.controller.md.sal.common.api.TransactionStatus; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; +import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.netconf.topology.singleton.api.NetconfDOMTransaction; import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import scala.concurrent.Future; public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction { + private static final Logger LOG = LoggerFactory.getLogger(NetconfWriteOnlyTransaction.class); + + private final RemoteDeviceId id; private final NetconfDOMTransaction delegate; private final ActorSystem actorSystem; - public NetconfWriteOnlyTransaction(final ActorSystem actorSystem, final NetconfDOMTransaction delegate) { + public NetconfWriteOnlyTransaction(final RemoteDeviceId id, + final ActorSystem actorSystem, + final NetconfDOMTransaction delegate) { + this.id = id; this.delegate = delegate; this.actorSystem = actorSystem; } @@ -41,27 +50,37 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction { @Override public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { + LOG.trace("{}: Write {} via NETCONF: {} with payload {}", id, store, path, data); + delegate.put(store, new NormalizedNodeMessage(path, data)); } @Override public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { + LOG.trace("{}: Merge {} via NETCONF: {} with payload {}", id, store, path, data); + delegate.merge(store, new NormalizedNodeMessage(path, data)); } @Override public boolean cancel() { + LOG.trace("{}: Cancel", id); + return delegate.cancel(); } @Override public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) { + LOG.trace("{}: Delete {} via NETCONF: {}", id, store, path); + delegate.delete(store, path); } @Override public CheckedFuture submit() { + LOG.trace("{}: Submit", id); + final Future submit = delegate.submit(); final SettableFuture settFuture = SettableFuture.create(); final CheckedFuture checkedFuture; @@ -87,6 +106,8 @@ public class NetconfWriteOnlyTransaction implements DOMDataWriteTransaction { @Override public ListenableFuture> commit() { + LOG.trace("{}: Commit", id); + final Future commit = delegate.submit(); final SettableFuture> settFuture = SettableFuture.create(); commit.onComplete(new OnComplete() { diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java index 661c51149f..c491ee6fe4 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ReadOnlyTransactionTest.java @@ -99,7 +99,7 @@ public class ReadOnlyTransactionTest { doReturn(readTx).when(delegateDataBroker).newReadOnlyTransaction(); final NetconfDOMTransaction masterDOMTransactions = - new NetconfMasterDOMTransaction(delegateDataBroker); + new NetconfMasterDOMTransaction(remoteDeviceId, delegateDataBroker); masterDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, masterDOMTransactions); @@ -107,7 +107,7 @@ public class ReadOnlyTransactionTest { // Create slave data broker for testing proxy final NetconfDOMTransaction proxyDOMTransactions = - new NetconfProxyDOMTransaction(system, masterRef); + new NetconfProxyDOMTransaction(remoteDeviceId, system, masterRef); slaveDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, proxyDOMTransactions); diff --git a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java index 97b0cec90a..c9fa38f4bd 100644 --- a/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java +++ b/netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/WriteOnlyTransactionTest.java @@ -41,6 +41,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.Mock; +import org.mockito.Mockito; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; @@ -106,7 +107,7 @@ public class WriteOnlyTransactionTest { doReturn(readTx).when(delegateDataBroker).newReadOnlyTransaction(); final NetconfDOMTransaction masterDOMTransactions = - new NetconfMasterDOMTransaction(delegateDataBroker); + new NetconfMasterDOMTransaction(remoteDeviceId, delegateDataBroker); masterDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, masterDOMTransactions); @@ -114,7 +115,7 @@ public class WriteOnlyTransactionTest { // Create slave data broker for testing proxy final NetconfDOMTransaction proxyDOMTransactions = - new NetconfProxyDOMTransaction(system, masterRef); + new NetconfProxyDOMTransaction(remoteDeviceId, system, masterRef); slaveDataBroker = new NetconfDOMDataBroker(system, remoteDeviceId, proxyDOMTransactions); -- 2.36.6