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%2FShardDataTreeTest.java;h=c31db3205f2cca111a695c5eb4c21a4c30b1cdfe;hb=204f45f8b3233dbea87e2c8065914f0d2a0ded07;hp=26787f63d6a79bc569823b4ac96d3a69b6710170;hpb=5e88a49144e75df470e23afec350f479d01f450e;p=controller.git 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 26787f63d6..c31db3205f 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 @@ -25,6 +25,7 @@ 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; +import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public class ShardDataTreeTest { @@ -38,12 +39,12 @@ public class ShardDataTreeTest { @Test public void testWrite() throws ExecutionException, InterruptedException { - modify(new ShardDataTree(fullSchema), false, true, true); + modify(new ShardDataTree(fullSchema, TreeType.OPERATIONAL), false, true, true); } @Test public void testMerge() throws ExecutionException, InterruptedException { - modify(new ShardDataTree(fullSchema), true, true, true); + modify(new ShardDataTree(fullSchema, TreeType.OPERATIONAL), true, true, true); } @@ -87,7 +88,7 @@ public class ShardDataTreeTest { @Test public void bug4359AddRemoveCarOnce() throws ExecutionException, InterruptedException { - ShardDataTree shardDataTree = new ShardDataTree(fullSchema); + ShardDataTree shardDataTree = new ShardDataTree(fullSchema, TreeType.OPERATIONAL); List candidates = new ArrayList<>(); candidates.add(addCar(shardDataTree)); @@ -104,7 +105,7 @@ public class ShardDataTreeTest { @Test public void bug4359AddRemoveCarTwice() throws ExecutionException, InterruptedException { - ShardDataTree shardDataTree = new ShardDataTree(fullSchema); + ShardDataTree shardDataTree = new ShardDataTree(fullSchema, TreeType.OPERATIONAL); List candidates = new ArrayList<>(); candidates.add(addCar(shardDataTree)); @@ -121,7 +122,7 @@ public class ShardDataTreeTest { assertEquals(expected, actual); } - private NormalizedNode getCars(ShardDataTree shardDataTree) { + private static NormalizedNode getCars(ShardDataTree shardDataTree) { ReadOnlyShardDataTreeTransaction readOnlyShardDataTreeTransaction = shardDataTree.newReadOnlyTransaction("txn-2", null); DataTreeSnapshot snapshot1 = readOnlyShardDataTreeTransaction.getSnapshot(); @@ -134,7 +135,7 @@ public class ShardDataTreeTest { return optional.get(); } - private DataTreeCandidateTip addCar(ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { + private static DataTreeCandidateTip addCar(ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { return doTransaction(shardDataTree, new DataTreeOperation() { @Override public void execute(DataTreeModification snapshot) { @@ -145,7 +146,7 @@ public class ShardDataTreeTest { }); } - private DataTreeCandidateTip removeCar(ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { + private static DataTreeCandidateTip removeCar(ShardDataTree shardDataTree) throws ExecutionException, InterruptedException { return doTransaction(shardDataTree, new DataTreeOperation() { @Override public void execute(DataTreeModification snapshot) { @@ -158,7 +159,7 @@ public class ShardDataTreeTest { public abstract void execute(DataTreeModification snapshot); } - private DataTreeCandidateTip doTransaction(ShardDataTree shardDataTree, DataTreeOperation operation) + private static DataTreeCandidateTip doTransaction(ShardDataTree shardDataTree, DataTreeOperation operation) throws ExecutionException, InterruptedException { ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction("txn-1", null); DataTreeModification snapshot = transaction.getSnapshot(); @@ -173,7 +174,7 @@ public class ShardDataTreeTest { return candidate; } - private DataTreeCandidateTip applyCandidates(ShardDataTree shardDataTree, List candidates) + private static DataTreeCandidateTip applyCandidates(ShardDataTree shardDataTree, List candidates) throws ExecutionException, InterruptedException { ReadWriteShardDataTreeTransaction transaction = shardDataTree.newReadWriteTransaction("txn-1", null); DataTreeModification snapshot = transaction.getSnapshot();