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%2FShardDataTreeTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardDataTreeTest.java;h=c38254769043d96d0902cfb27d1d7f4de2e15514;hp=5a096acbb1206075e438a87042bf54877545182a;hb=a0332590d14ab7aad0247ae12bff4205c90cac94;hpb=ba99b089ca16480dd8b65b814f68e3fd26ab1246 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java index 5a096acbb1..c382547690 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java @@ -42,7 +42,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; -import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateTip; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot; @@ -122,7 +121,7 @@ public class ShardDataTreeTest extends AbstractTest { public void bug4359AddRemoveCarOnce() throws ExecutionException, InterruptedException { final ShardDataTree shardDataTree = new ShardDataTree(mockShard, fullSchema, TreeType.OPERATIONAL); - final List candidates = new ArrayList<>(); + final List candidates = new ArrayList<>(); candidates.add(addCar(shardDataTree)); candidates.add(removeCar(shardDataTree)); @@ -139,7 +138,7 @@ public class ShardDataTreeTest extends AbstractTest { public void bug4359AddRemoveCarTwice() throws ExecutionException, InterruptedException { final ShardDataTree shardDataTree = new ShardDataTree(mockShard, fullSchema, TreeType.OPERATIONAL); - final List candidates = new ArrayList<>(); + final List candidates = new ArrayList<>(); candidates.add(addCar(shardDataTree)); candidates.add(removeCar(shardDataTree)); candidates.add(addCar(shardDataTree)); @@ -197,8 +196,8 @@ public class ShardDataTreeTest extends AbstractTest { } @SuppressWarnings({ "rawtypes", "unchecked" }) - private static void verifyOnDataTreeChanged(DOMDataTreeChangeListener listener, - Consumer callback) { + private static void verifyOnDataTreeChanged(final DOMDataTreeChangeListener listener, + final Consumer callback) { ArgumentCaptor changes = ArgumentCaptor.forClass(Collection.class); verify(listener, atLeastOnce()).onDataTreeChanged(changes.capture()); for (Collection list : changes.getAllValues()) { @@ -222,12 +221,12 @@ public class ShardDataTreeTest extends AbstractTest { return optional.get(); } - private static DataTreeCandidateTip addCar(final ShardDataTree shardDataTree) + private static DataTreeCandidate addCar(final ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { return addCar(shardDataTree, "altima"); } - private static DataTreeCandidateTip addCar(final ShardDataTree shardDataTree, String name) + private static DataTreeCandidate addCar(final ShardDataTree shardDataTree, final String name) throws ExecutionException, InterruptedException { return doTransaction(shardDataTree, snapshot -> { snapshot.merge(CarsModel.BASE_PATH, CarsModel.emptyContainer()); @@ -236,7 +235,7 @@ public class ShardDataTreeTest extends AbstractTest { }); } - private static DataTreeCandidateTip removeCar(final ShardDataTree shardDataTree) + private static DataTreeCandidate removeCar(final ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { return doTransaction(shardDataTree, snapshot -> snapshot.delete(CarsModel.newCarPath("altima"))); } @@ -246,7 +245,7 @@ public class ShardDataTreeTest extends AbstractTest { void execute(DataTreeModification snapshot); } - private static DataTreeCandidateTip doTransaction(final ShardDataTree shardDataTree, + private static DataTreeCandidate doTransaction(final ShardDataTree shardDataTree, final DataTreeOperation operation) throws ExecutionException, InterruptedException { final ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction(nextTransactionId()); @@ -256,25 +255,25 @@ public class ShardDataTreeTest extends AbstractTest { immediateCanCommit(cohort); immediatePreCommit(cohort); - final DataTreeCandidateTip candidate = cohort.getCandidate(); + final DataTreeCandidate candidate = cohort.getCandidate(); immediateCommit(cohort); return candidate; } - private static DataTreeCandidateTip applyCandidates(final ShardDataTree shardDataTree, - final List candidates) throws ExecutionException, InterruptedException { + private static DataTreeCandidate applyCandidates(final ShardDataTree shardDataTree, + final List candidates) throws ExecutionException, InterruptedException { final ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction(nextTransactionId()); final DataTreeModification snapshot = transaction.getSnapshot(); - for (final DataTreeCandidateTip candidateTip : candidates) { + for (final DataTreeCandidate candidateTip : candidates) { DataTreeCandidates.applyToModification(snapshot, candidateTip); } final ShardDataTreeCohort cohort = shardDataTree.finishTransaction(transaction); immediateCanCommit(cohort); immediatePreCommit(cohort); - final DataTreeCandidateTip candidate = cohort.getCandidate(); + final DataTreeCandidate candidate = cohort.getCandidate(); immediateCommit(cohort); return candidate;