X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDistributedDataStoreIntegrationTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDistributedDataStoreIntegrationTest.java;h=482021aa8b78cfc01a2d503ec5c592730d9217a8;hp=3d59ebbb01c0cd822521c1da71aa29ea5bd6bb9e;hb=e254db554221f96c911f93a6a3e9a1c1e0238c3d;hpb=995da01ef2d635230c37afc7cf4fdd724bf68856 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java index 3d59ebbb01..482021aa8b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java @@ -71,7 +71,6 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.mdsal.common.api.ReadFailedException; import org.opendaylight.mdsal.common.api.TransactionChainClosedException; import org.opendaylight.mdsal.common.api.TransactionChainListener; -import org.opendaylight.mdsal.common.api.TransactionCommitFailedException; import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction; import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction; import org.opendaylight.mdsal.dom.api.DOMTransactionChain; @@ -931,12 +930,12 @@ public class DistributedDataStoreIntegrationTest { final TransactionChainListener listener = Mockito.mock(TransactionChainListener.class); DOMTransactionChain txChain = broker.createTransactionChain(listener); - final List> futures = new ArrayList<>(); + final List> futures = new ArrayList<>(); final DOMDataTreeWriteTransaction writeTx = txChain.newWriteOnlyTransaction(); writeTx.put(LogicalDatastoreType.CONFIGURATION, CarsModel.BASE_PATH, CarsModel.emptyContainer()); writeTx.put(LogicalDatastoreType.CONFIGURATION, CarsModel.CAR_LIST_PATH, CarsModel.newCarMapNode()); - futures.add(writeTx.submit()); + futures.add(writeTx.commit()); int numCars = 100; for (int i = 0; i < numCars; i++) { @@ -945,11 +944,11 @@ public class DistributedDataStoreIntegrationTest { rwTx.merge(LogicalDatastoreType.CONFIGURATION, CarsModel.newCarPath("car" + i), CarsModel.newCarEntry("car" + i, BigInteger.valueOf(20000))); - futures.add(rwTx.submit()); + futures.add(rwTx.commit()); } - for (final CheckedFuture f : futures) { - f.checkedGet(); + for (final ListenableFuture f : futures) { + f.get(5, TimeUnit.SECONDS); } final Optional> optional = txChain.newReadOnlyTransaction() @@ -1102,9 +1101,9 @@ public class DistributedDataStoreIntegrationTest { writeTx.merge(LogicalDatastoreType.CONFIGURATION, CarsModel.BASE_PATH, invalidData); try { - writeTx.submit().checkedGet(5, TimeUnit.SECONDS); + writeTx.commit().get(5, TimeUnit.SECONDS); fail("Expected TransactionCommitFailedException"); - } catch (final TransactionCommitFailedException e) { + } catch (final ExecutionException e) { // Expected } @@ -1148,9 +1147,9 @@ public class DistributedDataStoreIntegrationTest { // succeeds b/c deep validation is not // done for put for performance reasons. try { - writeTx.submit().checkedGet(5, TimeUnit.SECONDS); + writeTx.commit().get(5, TimeUnit.SECONDS); fail("Expected TransactionCommitFailedException"); - } catch (final TransactionCommitFailedException e) { + } catch (final ExecutionException e) { // Expected }