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%2FShardRecoveryCoordinatorTest.java;h=f4468b0e59d025a87f44365fc37e5797668e33a4;hb=6a5a8670a47f8989998390b6bab6718c1a7857b5;hp=49b093770b47132b53f165af023e02d85baaa22b;hpb=fd38fb36d0992a3a2391837f6e12615ed98a8bb5;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinatorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinatorTest.java index 49b093770b..f4468b0e59 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinatorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinatorTest.java @@ -14,7 +14,6 @@ import com.google.common.base.Optional; import java.io.IOException; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.cluster.datastore.modification.ModificationPayload; import org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification; import org.opendaylight.controller.cluster.datastore.modification.WriteModification; import org.opendaylight.controller.cluster.datastore.utils.SerializationUtils; @@ -46,12 +45,13 @@ public class ShardRecoveryCoordinatorTest { peopleSchemaContext = SchemaContextHelper.select(SchemaContextHelper.PEOPLE_YANG); carsSchemaContext = SchemaContextHelper.select(SchemaContextHelper.CARS_YANG); - peopleDataTree = new ShardDataTree(peopleSchemaContext); + peopleDataTree = new ShardDataTree(peopleSchemaContext, TreeType.OPERATIONAL); } @Test public void testAppendRecoveredLogEntryDataTreeCandidatePayload(){ - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); + final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, + peopleSchemaContext, null, "foobar", LoggerFactory.getLogger("foo")); coordinator.startLogRecoveryBatch(10); try { coordinator.appendRecoveredLogEntry(DataTreeCandidatePayload.create(createCar())); @@ -62,22 +62,10 @@ public class ShardRecoveryCoordinatorTest { coordinator.applyCurrentLogRecoveryBatch(); } - @Test - public void testAppendRecoveredLogEntryModificationPayload() throws IOException { - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); - coordinator.startLogRecoveryBatch(10); - try { - final MutableCompositeModification modification = new MutableCompositeModification((short) 1); - modification.addModification(new WriteModification(CarsModel.BASE_PATH, CarsModel.create())); - coordinator.appendRecoveredLogEntry(new ModificationPayload(modification)); - } catch(final SchemaValidationFailedException e){ - fail("SchemaValidationFailedException should not happen if pruning is done"); - } - } - @Test public void testAppendRecoveredLogEntryCompositeModificationPayload() throws IOException { - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); + final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, + peopleSchemaContext, null, "foobar", LoggerFactory.getLogger("foo")); coordinator.startLogRecoveryBatch(10); try { final MutableCompositeModification modification = new MutableCompositeModification((short) 1); @@ -90,7 +78,8 @@ public class ShardRecoveryCoordinatorTest { @Test public void testAppendRecoveredLogEntryCompositeModificationByteStringPayload() throws IOException { - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); + final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, + peopleSchemaContext, null, "foobar", LoggerFactory.getLogger("foo")); coordinator.startLogRecoveryBatch(10); try { final MutableCompositeModification modification = new MutableCompositeModification((short) 1); @@ -105,7 +94,8 @@ public class ShardRecoveryCoordinatorTest { @Test public void testApplyRecoverySnapshot(){ - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree , peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); + final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, + peopleSchemaContext, null, "foobar", LoggerFactory.getLogger("foo")); coordinator.startLogRecoveryBatch(10); coordinator.applyRecoverySnapshot(createSnapshot()); @@ -117,7 +107,8 @@ public class ShardRecoveryCoordinatorTest { @Test public void testApplyCurrentLogRecoveryBatch(){ - final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, peopleSchemaContext, "foobar", LoggerFactory.getLogger("foo")); + final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree, + peopleSchemaContext, null, "foobar", LoggerFactory.getLogger("foo")); coordinator.startLogRecoveryBatch(10); try {