import org.junit.Test;
import org.mockito.Mockito;
import org.opendaylight.controller.cluster.datastore.persisted.CommitTransactionPayload;
-import org.opendaylight.controller.cluster.datastore.persisted.PreBoronShardDataTreeSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.MetadataShardDataTreeSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.ShardSnapshotState;
import org.opendaylight.controller.md.cluster.datastore.model.CarsModel;
import org.opendaylight.controller.md.cluster.datastore.model.PeopleModel;
import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
peopleDataTree = new ShardDataTree(mockShard, peopleSchemaContext, TreeType.OPERATIONAL);
}
- @Deprecated
- @Test
- public void testAppendRecoveredLogEntryDataTreeCandidatePayload() {
- final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree,
- null, "foobar", LoggerFactory.getLogger("foo"));
- coordinator.startLogRecoveryBatch(10);
- try {
- coordinator.appendRecoveredLogEntry(DataTreeCandidatePayload.create(createCar()));
- } catch (final SchemaValidationFailedException e) {
- fail("SchemaValidationFailedException should not happen if pruning is done");
- }
-
- coordinator.applyCurrentLogRecoveryBatch();
- }
-
@Test
public void testAppendRecoveredLogEntryCommitTransactionPayload() throws IOException {
final ShardRecoveryCoordinator coordinator = new ShardRecoveryCoordinator(peopleDataTree,
return shardDataTree.readNode(PeopleModel.BASE_PATH);
}
- private static byte[] createSnapshot() {
+ private static ShardSnapshotState createSnapshot() {
final TipProducingDataTree dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
dataTree.setSchemaContext(SchemaContextHelper.select(SchemaContextHelper.CARS_YANG,
SchemaContextHelper.PEOPLE_YANG));
modification.ready();
dataTree.commit(dataTree.prepare(modification));
- return new PreBoronShardDataTreeSnapshot(dataTree.takeSnapshot().readNode(YangInstanceIdentifier.EMPTY).get())
- .serialize();
+ return new ShardSnapshotState(new MetadataShardDataTreeSnapshot(dataTree.takeSnapshot().readNode(
+ YangInstanceIdentifier.EMPTY).get()));
}
}