*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
- public void parentConcurrentlyDeletedExisting() {
- InMemoryDataTreeModification initial = tree.takeSnapshot().newModification();
+ public void parentConcurrentlyDeletedExisting() throws DataValidationFailedException {
+ DataTreeModification initial = tree.takeSnapshot().newModification();
// We write node without creating parent
initial.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
initial.ready();
// We commit transaction
tree.commit(tree.prepare(initial));
// We write node without creating parent
initial.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
initial.ready();
// We commit transaction
tree.commit(tree.prepare(initial));
- InMemoryDataTreeModification writeTx = tree.takeSnapshot().newModification();
- InMemoryDataTreeModification deleteTx = tree.takeSnapshot().newModification();
+ final DataTreeModification writeTx = tree.takeSnapshot().newModification();
+ final DataTreeModification deleteTx = tree.takeSnapshot().newModification();
deleteTx.delete(TestModel.TEST_PATH);
deleteTx.ready();
// We commit delete modification
tree.commit(tree.prepare(deleteTx));
writeTx.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME).build());
deleteTx.delete(TestModel.TEST_PATH);
deleteTx.ready();
// We commit delete modification
tree.commit(tree.prepare(deleteTx));
writeTx.write(TestModel.OUTER_LIST_PATH, ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME).build());
} catch (DataValidationFailedException e) {
fail("ConflictingModificationAppliedException expected");
}
} catch (DataValidationFailedException e) {
fail("ConflictingModificationAppliedException expected");
}