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%2FAbstractShardTest.java;h=3f0a1bfc861ab34b9499bc47a2da7af345f4f136;hb=fcc7cfb5ff0efacb4460567a9a7df83988fdcfec;hp=97c9e923a9b656eb067242f1c27bb8a121dd13e8;hpb=a507f19b518f36065c74f4f88c9327ede28ff640;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java index 97c9e923a9..3f0a1bfc86 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java @@ -271,6 +271,17 @@ public abstract class AbstractShardTest extends AbstractActorTest{ cohort.commit(); } + public static void mergeToStore(final ShardDataTree store, final YangInstanceIdentifier id, + final NormalizedNode node) throws InterruptedException, ExecutionException { + final ReadWriteShardDataTreeTransaction transaction = store.newReadWriteTransaction("writeToStore", null); + + transaction.getSnapshot().merge(id, node); + final ShardDataTreeCohort cohort = transaction.ready(); + cohort.canCommit().get(); + cohort.preCommit().get(); + cohort.commit(); + } + public static void writeToStore(final DataTree store, final YangInstanceIdentifier id, final NormalizedNode node) throws DataValidationFailedException { final DataTreeModification transaction = store.takeSnapshot().newModification();