X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDOMTransactionChainTest.java;h=2a955e5f4215e6dccc0c397ca9c0850ccb159aa3;hp=b360cb1694eab7224980ed6ed078f39a51942e1e;hb=edd496cfa77b7f09f77e8ed9196cc96c748b48f4;hpb=3813fb17592a2469c26b3874c4673a80fa3b9aee diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java index b360cb1694..2a955e5f42 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java +++ b/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMTransactionChainTest.java @@ -71,8 +71,8 @@ public class DOMTransactionChainTest { /** * We alocate new read-write transaction and write /test - * - * + * + * */ DOMDataReadWriteTransaction firstTx = allocateAndWrite(txChain); @@ -88,19 +88,19 @@ public class DOMTransactionChainTest { DOMDataReadTransaction secondReadTx = txChain.newReadOnlyTransaction(); /** - * + * * We test if we are able to read data from tx, read should not fail * since we are using chained transaction. - * - * + * + * */ assertTestContainerExists(secondReadTx); /** - * + * * We alocate next transaction, which is still based on first one, but * is read-write. - * + * */ DOMDataReadWriteTransaction thirdDeleteTx = allocateAndDelete(txChain); @@ -111,7 +111,7 @@ public class DOMTransactionChainTest { /** * We commit first transaction - * + * */ assertCommitSuccessful(firstWriteTxFuture); @@ -124,7 +124,7 @@ public class DOMTransactionChainTest { assertTestContainerExists(storeReadTx); /** * We commit third transaction - * + * */ assertCommitSuccessful(thirdDeleteTxFuture); @@ -144,8 +144,8 @@ public class DOMTransactionChainTest { /** * We alocate new read-write transaction and write /test - * - * + * + * */ allocateAndWrite(txChain); @@ -155,21 +155,21 @@ public class DOMTransactionChainTest { * IllegalStateException. */ try { - DOMDataReadTransaction secondReadTx = txChain.newReadOnlyTransaction(); + txChain.newReadOnlyTransaction(); fail("Allocation of secondReadTx should fail with IllegalStateException"); } catch (Exception e) { assertTrue(e instanceof IllegalStateException); } } - private static DOMDataReadWriteTransaction allocateAndDelete(DOMTransactionChain txChain) + private static DOMDataReadWriteTransaction allocateAndDelete(final DOMTransactionChain txChain) throws InterruptedException, ExecutionException { DOMDataReadWriteTransaction tx = txChain.newReadWriteTransaction(); /** * We test existence of /test in third transaction container should * still be visible from first one (which is still uncommmited). - * + * */ assertTestContainerExists(tx); @@ -180,28 +180,28 @@ public class DOMTransactionChainTest { return tx; } - private static DOMDataReadWriteTransaction allocateAndWrite(DOMTransactionChain txChain) + private static DOMDataReadWriteTransaction allocateAndWrite(final DOMTransactionChain txChain) throws InterruptedException, ExecutionException { DOMDataReadWriteTransaction tx = txChain.newReadWriteTransaction(); assertTestContainerWrite(tx); return tx; } - private static void assertCommitSuccessful(ListenableFuture> future) + private static void assertCommitSuccessful(final ListenableFuture> future) throws InterruptedException, ExecutionException { RpcResult rpcResult = future.get(); assertTrue(rpcResult.isSuccessful()); assertEquals(TransactionStatus.COMMITED, rpcResult.getResult()); } - private static void assertTestContainerExists(DOMDataReadTransaction readTx) throws InterruptedException, + private static void assertTestContainerExists(final DOMDataReadTransaction readTx) throws InterruptedException, ExecutionException { ListenableFuture>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH); Optional> readedData = readFuture.get(); assertTrue(readedData.isPresent()); } - private static void assertTestContainerWrite(DOMDataReadWriteTransaction tx) throws InterruptedException, + private static void assertTestContainerWrite(final DOMDataReadWriteTransaction tx) throws InterruptedException, ExecutionException { tx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME)); assertTestContainerExists(tx);