X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2FAbstractEntityOwnershipTest.java;h=9315cc2ddef123a21690be402f8e6b55b5b9e8cd;hb=4d1709660b7af992d4c382a2a38debb5c7d64fb9;hp=ea7648efb9df918bd034f858f6d26eebd5a48afd;hpb=1f3f61ea49191bb0ada2d4de831a10f0a38a104d;p=controller.git 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,