import static org.junit.Assert.fail;
import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
import static org.junit.Assert.fail;
import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.OPERATIONAL;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.ListenableFuture;
- ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore> builder() //
+ ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder() //
.put(CONFIGURATION, configStore) //
.put(OPERATIONAL, operStore) //
.build();
.put(CONFIGURATION, configStore) //
.put(OPERATIONAL, operStore) //
.build();
*/
DOMDataReadWriteTransaction firstTx = allocateAndWrite(txChain);
/**
* First transaction is marked as ready, we are able to allocate chained
*/
DOMDataReadWriteTransaction firstTx = allocateAndWrite(txChain);
/**
* First transaction is marked as ready, we are able to allocate chained
*
* We test if we are able to read data from tx, read should not fail
* since we are using chained transaction.
*
* We test if we are able to read data from tx, read should not fail
* since we are using chained transaction.
- public void testTransactionChainNotSealed() throws InterruptedException, ExecutionException, TimeoutException {
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ public void testTransactionChainNotSealed() throws InterruptedException, ExecutionException {
BlockingTransactionChainListener listener = new BlockingTransactionChainListener();
DOMTransactionChain txChain = domBroker.createTransactionChain(listener);
assertNotNull(txChain);
/**
* We alocate new read-write transaction and write /test
BlockingTransactionChainListener listener = new BlockingTransactionChainListener();
DOMTransactionChain txChain = domBroker.createTransactionChain(listener);
assertNotNull(txChain);
/**
* We alocate new read-write transaction and write /test
- private static DOMDataReadWriteTransaction allocateAndDelete(final DOMTransactionChain txChain)
- throws InterruptedException, ExecutionException {
+ private static DOMDataReadWriteTransaction allocateAndDelete(
+ final DOMTransactionChain txChain) throws InterruptedException, ExecutionException {
- private static void assertTestContainerExists(final DOMDataReadTransaction readTx) throws InterruptedException,
- ExecutionException {
+ private static void assertTestContainerExists(final DOMDataReadTransaction readTx)
+ throws InterruptedException, ExecutionException {
ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH);
Optional<NormalizedNode<?, ?>> readedData = readFuture.get();
assertTrue(readedData.isPresent());
}
ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH);
Optional<NormalizedNode<?, ?>> readedData = readFuture.get();
assertTrue(readedData.isPresent());
}
- private static void assertTestContainerWrite(final DOMDataReadWriteTransaction tx) throws InterruptedException,
- ExecutionException {
+ private static void assertTestContainerWrite(final DOMDataReadWriteTransaction tx)
+ throws InterruptedException, ExecutionException {
tx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
assertTestContainerExists(tx);
}
tx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
assertTestContainerExists(tx);
}