import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration;
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.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
import org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaValidationFailedException;
}
@Test
- public void testAppendRecoveredLogEntryCommitTransactionPayload() throws IOException {
+ public void testAppendRecoveredLogEntryCommitTransactionPayload() throws IOException,
+ DataValidationFailedException {
try {
coordinator.appendRecoveredLogEntry(CommitTransactionPayload.create(nextTransactionId(), createCar()));
} catch (final SchemaValidationFailedException e) {
}
@Test
- public void testApplyRecoverySnapshot() {
+ public void testApplyRecoverySnapshot() throws DataValidationFailedException {
coordinator.applyRecoverySnapshot(createSnapshot());
assertFalse(readCars(peopleDataTree).isPresent());
}
}
- private DataTreeCandidate createCar() {
+ private DataTreeCandidate createCar() throws DataValidationFailedException {
final DataTree dataTree = new InMemoryDataTreeFactory().create(
DataTreeConfiguration.DEFAULT_OPERATIONAL, carsSchemaContext);
return shardDataTree.readNode(PeopleModel.BASE_PATH);
}
- private static ShardSnapshotState createSnapshot() {
+ private static ShardSnapshotState createSnapshot() throws DataValidationFailedException {
final DataTree dataTree = new InMemoryDataTreeFactory().create(
DataTreeConfiguration.DEFAULT_OPERATIONAL, SchemaContextHelper.select(SchemaContextHelper.CARS_YANG,
SchemaContextHelper.PEOPLE_YANG));