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%2Fentityownership%2FAbstractEntityOwnershipTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2FAbstractEntityOwnershipTest.java;h=9315cc2ddef123a21690be402f8e6b55b5b9e8cd;hp=ea7648efb9df918bd034f858f6d26eebd5a48afd;hb=94603c85193862f85bf9d9aa51d5062d9f84e979;hpb=9402730d96f9633d2165de99fad65768d8537a9a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnershipTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnershipTest.java index ea7648efb9..9315cc2dde 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnershipTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnershipTest.java @@ -45,7 +45,6 @@ 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.DataTreeCandidateTip; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; @@ -156,26 +155,21 @@ public class AbstractEntityOwnershipTest extends AbstractActorTest { static void writeNode(YangInstanceIdentifier path, NormalizedNode node, ShardDataTree shardDataTree) throws DataValidationFailedException { - DataTreeModification modification = shardDataTree.getDataTree().takeSnapshot().newModification(); + DataTreeModification modification = shardDataTree.newModification(); modification.merge(path, node); commit(shardDataTree, modification); } static void deleteNode(YangInstanceIdentifier path, ShardDataTree shardDataTree) throws DataValidationFailedException { - DataTreeModification modification = shardDataTree.getDataTree().takeSnapshot().newModification(); + DataTreeModification modification = shardDataTree.newModification(); modification.delete(path); commit(shardDataTree, modification); } static void commit(ShardDataTree shardDataTree, DataTreeModification modification) throws DataValidationFailedException { - modification.ready(); - - shardDataTree.getDataTree().validate(modification); - DataTreeCandidateTip candidate = shardDataTree.getDataTree().prepare(modification); - shardDataTree.getDataTree().commit(candidate); - shardDataTree.notifyListeners(candidate); + shardDataTree.notifyListeners(shardDataTree.commit(modification)); } static EntityOwnershipChange ownershipChange(final Entity expEntity, final boolean expWasOwner,