import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
+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.DataValidationFailedException;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.TipProducingDataTree;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
ShardTestKit.waitUntilLeader(shard);
- final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
- store.setSchemaContext(SCHEMA_CONTEXT);
+ final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+ SCHEMA_CONTEXT);
final ContainerNode container = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
ShardTestKit.waitUntilLeader(shard);
- final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
- store.setSchemaContext(SCHEMA_CONTEXT);
+ final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+ SCHEMA_CONTEXT);
final DataTreeModification writeMod = store.takeSnapshot().newModification();
final ContainerNode node = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
private void testCommitWhenTransactionHasModifications(final boolean readWrite) throws Exception {
new ShardTestKit(getSystem()) {
{
- final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+ final DataTree dataTree = createDelegatingMockDataTree();
final TestActorRef<Shard> shard = actorFactory.createTestActor(
newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
"testCommitWhenTransactionHasModifications-" + readWrite);
public void testCommitPhaseFailure() throws Exception {
new ShardTestKit(getSystem()) {
{
- final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+ final DataTree dataTree = createDelegatingMockDataTree();
final TestActorRef<Shard> shard = actorFactory.createTestActor(
newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
"testCommitPhaseFailure");
public void testPreCommitPhaseFailure() throws Exception {
new ShardTestKit(getSystem()) {
{
- final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+ final DataTree dataTree = createDelegatingMockDataTree();
final TestActorRef<Shard> shard = actorFactory.createTestActor(
newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
"testPreCommitPhaseFailure");
public void testCanCommitPhaseFailure() throws Exception {
new ShardTestKit(getSystem()) {
{
- final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+ final DataTree dataTree = createDelegatingMockDataTree();
final TestActorRef<Shard> shard = actorFactory.createTestActor(
newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
"testCanCommitPhaseFailure");
private void testImmediateCommitWithCanCommitPhaseFailure(final boolean readWrite) throws Exception {
new ShardTestKit(getSystem()) {
{
- final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+ final DataTree dataTree = createDelegatingMockDataTree();
final TestActorRef<Shard> shard = actorFactory.createTestActor(
newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
"testImmediateCommitWithCanCommitPhaseFailure-" + readWrite);
*/
@Test
public void testInMemoryDataTreeRestore() throws ReadFailedException, DataValidationFailedException {
- final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
- store.setSchemaContext(SCHEMA_CONTEXT);
+ final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+ SCHEMA_CONTEXT);
final DataTreeModification putTransaction = store.takeSnapshot().newModification();
putTransaction.write(TestModel.TEST_PATH,