Remove deprecated ShardDataTree#commit method
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / entityownership / AbstractEntityOwnershipTest.java
index da8de32..05d37fd 100644 (file)
@@ -58,6 +58,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 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.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
 import org.slf4j.Logger;
@@ -204,7 +205,11 @@ public class AbstractEntityOwnershipTest extends AbstractActorTest {
 
     static void commit(ShardDataTree shardDataTree, DataTreeModification modification)
             throws DataValidationFailedException {
-        shardDataTree.notifyListeners(shardDataTree.commit(modification));
+        modification.ready();
+        shardDataTree.getDataTree().validate(modification);
+        final DataTreeCandidate candidate = shardDataTree.getDataTree().prepare(modification);
+        shardDataTree.getDataTree().commit(candidate);
+        shardDataTree.notifyListeners(candidate);
     }
 
     static DOMEntityOwnershipChange ownershipChange(final DOMEntity expEntity, final boolean expWasOwner,

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.