Merge "Fixup Augmentable and Identifiable methods changing"
[netconf.git] / netconf / netconf-topology-singleton / src / test / java / org / opendaylight / netconf / topology / singleton / impl / tx / ProxyWriteTransactionTest.java
index 05ad6be8dd82cd92becafcd30f693ab79f1f4cad..159bdc1a7ed10084722417bccece988f664123a1 100644 (file)
@@ -22,7 +22,6 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-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.netconf.sal.connect.util.RemoteDeviceId;
@@ -33,7 +32,6 @@ import org.opendaylight.netconf.topology.singleton.messages.transactions.PutRequ
 import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitReply;
 import org.opendaylight.netconf.topology.singleton.messages.transactions.SubmitRequest;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
@@ -53,7 +51,7 @@ public class ProxyWriteTransactionTest {
         masterActor = new TestProbe(system);
         final RemoteDeviceId id = new RemoteDeviceId("dev1", InetSocketAddress.createUnresolved("localhost", 17830));
         node = Builders.containerBuilder()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(QName.create("cont")))
+                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(QName.create("", "cont")))
                 .build();
         tx = new ProxyWriteTransaction(masterActor.ref(), id, system, Timeout.apply(5, TimeUnit.SECONDS));
     }
@@ -73,10 +71,10 @@ public class ProxyWriteTransactionTest {
 
     @Test
     public void testCancelSubmitted() throws Exception {
-        final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = tx.submit();
+        final ListenableFuture<Void> submitFuture = tx.submit();
         masterActor.expectMsgClass(SubmitRequest.class);
         masterActor.reply(new SubmitReply());
-        submitFuture.checkedGet();
+        submitFuture.get();
         final Future<Boolean> submit = Executors.newSingleThreadExecutor().submit(() -> tx.cancel());
         masterActor.expectNoMsg();
         Assert.assertFalse(submit.get());
@@ -84,18 +82,18 @@ public class ProxyWriteTransactionTest {
 
     @Test
     public void testSubmit() throws Exception {
-        final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = tx.submit();
+        final ListenableFuture<Void> submitFuture = tx.submit();
         masterActor.expectMsgClass(SubmitRequest.class);
         masterActor.reply(new SubmitReply());
-        submitFuture.checkedGet();
+        submitFuture.get();
     }
 
     @Test
     public void testDoubleSubmit() throws Exception {
-        final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = tx.submit();
+        final ListenableFuture<Void> submitFuture = tx.submit();
         masterActor.expectMsgClass(SubmitRequest.class);
         masterActor.reply(new SubmitReply());
-        submitFuture.checkedGet();
+        submitFuture.get();
         try {
             tx.submit().checkedGet();
             Assert.fail("Should throw IllegalStateException");
@@ -104,14 +102,6 @@ public class ProxyWriteTransactionTest {
         }
     }
 
-    @Test
-    public void testCommit() throws Exception {
-        final ListenableFuture<RpcResult<TransactionStatus>> submitFuture = tx.commit();
-        masterActor.expectMsgClass(SubmitRequest.class);
-        masterActor.reply(new SubmitReply());
-        Assert.assertEquals(TransactionStatus.SUBMITED, submitFuture.get().getResult());
-    }
-
     @Test
     public void testDelete() throws Exception {
         tx.delete(STORE, PATH);
@@ -175,4 +165,4 @@ public class ProxyWriteTransactionTest {
         submit.checkedGet();
     }
 
-}
\ No newline at end of file
+}