@Test public void testWriteRootNodeWithInvalidChild() throws Exception { final Shard mockShard = Mockito.mock(Shard.class); ShardDataTree shardDataTree = new ShardDataTree(mockShard, SCHEMA_CONTEXT, TreeType.CONFIGURATION); NormalizedNode<?, ?> root = shardDataTree.readNode(YangInstanceIdentifier.empty()).get(); NormalizedNode<?, ?> normalizedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier( new YangInstanceIdentifier.NodeIdentifier(root.getNodeType())).withChild( ImmutableNodes.containerNode(AUG_CONTAINER)).build(); pruningDataTreeModification.write(YangInstanceIdentifier.empty(), normalizedNode); dataTree.commit(getCandidate()); Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(YangInstanceIdentifier.empty()); assertEquals("Root present", true, actual.isPresent()); assertEquals("Root node", root, actual.get()); }
@Override public final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier) { return delegate.readNode(yangInstanceIdentifier); }
PruningDataTreeModification extends ForwardingObject implements DataTreeModification { @Override public final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier) { return delegate.readNode(yangInstanceIdentifier); } }
PruningDataTreeModification extends ForwardingObject implements DataTreeModification { @Override public final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier) { return delegate.readNode(yangInstanceIdentifier); } PruningDataTreeModification(final DataTreeModification delegate, final DataTree dataTree,
            final ReusableNormalizedNodePruner pruner); }
PruningDataTreeModification extends ForwardingObject implements DataTreeModification { @Override public final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier) { return delegate.readNode(yangInstanceIdentifier); } PruningDataTreeModification(final DataTreeModification delegate, final DataTree dataTree,
            final ReusableNormalizedNodePruner pruner); @Override final EffectiveModelContext getEffectiveModelContext(); @Override final void delete(final YangInstanceIdentifier path); @Override final void ready(); @Override final void applyToCursor(final DataTreeModificationCursor dataTreeModificationCursor); @Override final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier); @Override final DataTreeModification newModification(); }
PruningDataTreeModification extends ForwardingObject implements DataTreeModification { @Override public final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier) { return delegate.readNode(yangInstanceIdentifier); } PruningDataTreeModification(final DataTreeModification delegate, final DataTree dataTree,
            final ReusableNormalizedNodePruner pruner); @Override final EffectiveModelContext getEffectiveModelContext(); @Override final void delete(final YangInstanceIdentifier path); @Override final void ready(); @Override final void applyToCursor(final DataTreeModificationCursor dataTreeModificationCursor); @Override final Optional<NormalizedNode<?, ?>> readNode(final YangInstanceIdentifier yangInstanceIdentifier); @Override final DataTreeModification newModification();  }