Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 1362: New AsyncWriteTransaction#submit method
[controller.git]
/
opendaylight
/
md-sal
/
sal-dom-broker
/
src
/
test
/
java
/
org
/
opendaylight
/
controller
/
md
/
sal
/
dom
/
broker
/
impl
/
DOMTransactionChainTest.java
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 2a955e5f4215e6dccc0c397ca9c0850ccb159aa3..3ea0bcefa5bab97ea12a9ead64e40cce49b78277 100644
(file)
--- 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
@@
-7,7
+7,6
@@
*/
package org.opendaylight.controller.md.sal.dom.broker.impl;
*/
package org.opendaylight.controller.md.sal.dom.broker.impl;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@
-21,7
+20,6
@@
import java.util.concurrent.TimeoutException;
import org.junit.Before;
import org.junit.Test;
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.dom.api.DOMDataReadTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction;
import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
@@
-29,7
+27,6
@@
import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.controller.md.sal.dom.store.impl.TestModel;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@
-80,7
+77,7
@@
public class DOMTransactionChainTest {
* First transaction is marked as ready, we are able to allocate chained
* transactions
*/
* First transaction is marked as ready, we are able to allocate chained
* transactions
*/
- ListenableFuture<
RpcResult<TransactionStatus>> firstWriteTxFuture = firstTx.com
mit();
+ ListenableFuture<
Void> firstWriteTxFuture = firstTx.sub
mit();
/**
* We alocate chained transaction - read transaction.
/**
* We alocate chained transaction - read transaction.
@@
-104,28
+101,29
@@
public class DOMTransactionChainTest {
*/
DOMDataReadWriteTransaction thirdDeleteTx = allocateAndDelete(txChain);
*/
DOMDataReadWriteTransaction thirdDeleteTx = allocateAndDelete(txChain);
- /**
- * third transaction is sealed.
- */
- ListenableFuture<RpcResult<TransactionStatus>> thirdDeleteTxFuture = thirdDeleteTx.commit();
-
/**
* We commit first transaction
*
*/
assertCommitSuccessful(firstWriteTxFuture);
/**
* We commit first transaction
*
*/
assertCommitSuccessful(firstWriteTxFuture);
- // Alocates store transaction
+ /**
+ *
+ * Allocates transaction from data store.
+ *
+ */
DOMDataReadTransaction storeReadTx = domBroker.newReadOnlyTransaction();
DOMDataReadTransaction storeReadTx = domBroker.newReadOnlyTransaction();
+
/**
* We verify transaction is commited to store, container should exists
* in datastore.
*/
assertTestContainerExists(storeReadTx);
/**
* We verify transaction is commited to store, container should exists
* in datastore.
*/
assertTestContainerExists(storeReadTx);
+
/**
/**
- * We commit third transaction
- *
+ * third transaction is sealed and commited
*/
*/
+ ListenableFuture<Void> thirdDeleteTxFuture = thirdDeleteTx.submit();
assertCommitSuccessful(thirdDeleteTxFuture);
/**
assertCommitSuccessful(thirdDeleteTxFuture);
/**
@@
-187,11
+185,9
@@
public class DOMTransactionChainTest {
return tx;
}
return tx;
}
- private static void assertCommitSuccessful(final ListenableFuture<
RpcResult<TransactionStatus>
> future)
+ private static void assertCommitSuccessful(final ListenableFuture<
Void
> future)
throws InterruptedException, ExecutionException {
throws InterruptedException, ExecutionException {
- RpcResult<TransactionStatus> rpcResult = future.get();
- assertTrue(rpcResult.isSuccessful());
- assertEquals(TransactionStatus.COMMITED, rpcResult.getResult());
+ future.get();
}
private static void assertTestContainerExists(final DOMDataReadTransaction readTx) throws InterruptedException,
}
private static void assertTestContainerExists(final DOMDataReadTransaction readTx) throws InterruptedException,