X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-topology-singleton%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftopology%2Fsingleton%2Fimpl%2Ftx%2FWriteOnlyTransactionTest.java;h=a13c9536254e6101c2b21f2bcf22fea53e1f2ae2;hb=9f38cf745d224b9e1dc56464c803dffcb5430a93;hp=46081a96f2a196f36340fc01c97c389a7e9e654f;hpb=8d24d07b1d0115f6d3adad23ba790106ccabe712;p=netconf.git 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 46081a96f2..a13c953625 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 @@ -27,9 +27,9 @@ import akka.testkit.JavaTestKit; import akka.testkit.TestActorRef; import akka.util.Timeout; import com.google.common.collect.Lists; +import com.google.common.net.InetAddresses; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; -import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.List; import java.util.concurrent.TimeUnit; @@ -44,6 +44,7 @@ import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFaile import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; +import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; import org.opendaylight.controller.md.sal.dom.api.DOMRpcService; import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.netconf.topology.singleton.impl.ProxyDOMDataBroker; @@ -75,6 +76,8 @@ public class WriteOnlyTransactionTest { private DOMDataWriteTransaction writeTx; @Mock private DOMRpcService domRpcService; + @Mock + private DOMMountPointService mountPointService; private ActorRef masterRef; private ProxyDOMDataBroker slaveDataBroker; private List sourceIdentifiers; @@ -89,12 +92,12 @@ public class WriteOnlyTransactionTest { system = ActorSystem.create(); final RemoteDeviceId remoteDeviceId = new RemoteDeviceId("netconf-topology", - new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 9999)); + new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9999)); final NetconfTopologySetup setup = mock(NetconfTopologySetup.class); doReturn(Duration.apply(0, TimeUnit.SECONDS)).when(setup).getIdleTimeout(); final Props props = NetconfNodeActor.props(setup, remoteDeviceId, DEFAULT_SCHEMA_REPOSITORY, - DEFAULT_SCHEMA_REPOSITORY, TIMEOUT); + DEFAULT_SCHEMA_REPOSITORY, TIMEOUT, mountPointService); masterRef = TestActorRef.create(system, props, "master_read"); @@ -113,8 +116,8 @@ public class WriteOnlyTransactionTest { new ProxyDOMDataBroker(system, remoteDeviceId, masterRef, Timeout.apply(5, TimeUnit.SECONDS)); initializeDataTest(); testNode = ImmutableContainerNodeBuilder.create() - .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(QName.create("TestQname"))) - .withChild(ImmutableNodes.leafNode(QName.create("NodeQname"), "foo")).build(); + .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(QName.create("", "TestQname"))) + .withChild(ImmutableNodes.leafNode(QName.create("", "NodeQname"), "foo")).build(); instanceIdentifier = YangInstanceIdentifier.EMPTY; storeType = LogicalDatastoreType.CONFIGURATION; } @@ -149,15 +152,12 @@ public class WriteOnlyTransactionTest { @Test public void testDelete() throws Exception { - final YangInstanceIdentifier instanceIdentifier = YangInstanceIdentifier.EMPTY; - final LogicalDatastoreType storeType = LogicalDatastoreType.CONFIGURATION; - // Test of invoking delete on master through slave proxy final DOMDataWriteTransaction wTx = slaveDataBroker.newWriteOnlyTransaction(); - wTx.delete(storeType, instanceIdentifier); + wTx.delete(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY); wTx.cancel(); - verify(writeTx, timeout(2000)).delete(storeType, instanceIdentifier); + verify(writeTx, timeout(2000)).delete(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY); } @Test @@ -177,7 +177,8 @@ public class WriteOnlyTransactionTest { @Test public void testSubmitWithOperation() throws Exception { - final CheckedFuture resultSubmitTx = Futures.immediateCheckedFuture(null); + final CheckedFuture resultSubmitTx = + Futures.immediateCheckedFuture(null); doReturn(resultSubmitTx).when(writeTx).submit(); // With Tx final DOMDataWriteTransaction wTx = slaveDataBroker.newWriteOnlyTransaction();