Use Builders in yang-data-tree-ri tests 44/103044/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Nov 2022 00:56:38 +0000 (01:56 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Nov 2022 01:27:22 +0000 (02:27 +0100)
We want to hide individual implementations, make sure tests are not
referencing them.

Change-Id: Id6f45b5b2469d949bb4e1aba840a57e2a273483a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/AbstractPrettyTreeTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/Bug4295Test.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/Bug4454Test.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/ConcurrentTreeModificationTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/ConfigStatementValidationTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/DataTreeCandidatesTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/ListConstraintsValidation.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/ModificationMetadataTreeTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/StoreTreeNodesTest.java
data/yang-data-tree-ri/src/test/java/org/opendaylight/yangtools/yang/data/tree/impl/YT1276Test.java

index 8186b7dd3f1398d62910116d978fd4b3a62f6302..b89d1820887612d21b5ea5b8b4b44f686d87a4fc 100644 (file)
@@ -27,13 +27,12 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UserLeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UserMapNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 
 public abstract class AbstractPrettyTreeTest {
     protected static final QName ROOT_QNAME = QName.create(
@@ -103,19 +102,19 @@ public abstract class AbstractPrettyTreeTest {
      *
      * @return A test node
      */
-    protected static NormalizedNode createContainerNode() {
-        return ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(ROOT_QNAME))
-                .withChild(createMapNode())
-                .withChild(createChoiceNode())
-                .withChild(createContainerFromAnotherNamespace())
-                .withChild(createLeafNode())
-                .withChild(createLeafSetNode())
-                .withChild(createUserLeafSetNode())
-                .withChild(createUserMapNode())
-                .withChild(createUnkeyedListNode())
-                .withChild(createAnyDataNode())
-                .build();
+    protected static ContainerNode createContainerNode() {
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(ROOT_QNAME))
+            .withChild(createMapNode())
+            .withChild(createChoiceNode())
+            .withChild(createContainerFromAnotherNamespace())
+            .withChild(createLeafNode())
+            .withChild(createLeafSetNode())
+            .withChild(createUserLeafSetNode())
+            .withChild(createUserMapNode())
+            .withChild(createUnkeyedListNode())
+            .withChild(createAnyDataNode())
+            .build();
     }
 
     protected static MapNode createMapNode() {
@@ -152,33 +151,28 @@ public abstract class AbstractPrettyTreeTest {
     }
 
     protected static ContainerNode createContainerFromAnotherNamespace() {
-        return ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(ANOTHER_QNAME))
-                .withChild(mapNodeBuilder(LIST_ANOTHER_NAMESPACE_QNAME)
-                        .withChild(mapEntry(LIST_ANOTHER_NAMESPACE_QNAME,
-                                LEAF_ANOTHER_NAMESPACE_QNAME,
-                                "Leaf from another namespace value"))
-                        .build())
-                .build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(ANOTHER_QNAME))
+            .withChild(mapNodeBuilder(LIST_ANOTHER_NAMESPACE_QNAME)
+                .withChild(mapEntry(LIST_ANOTHER_NAMESPACE_QNAME, LEAF_ANOTHER_NAMESPACE_QNAME,
+                    "Leaf from another namespace value"))
+                .build())
+            .build();
     }
 
     protected static LeafNode<String> createLeafNode() {
-        return Builders.<String>leafBuilder()
-                .withNodeIdentifier(NodeIdentifier.create(LEAF_QNAME))
-                .withValue("Leaf value")
-                .build();
+        return ImmutableNodes.leafNode(LEAF_QNAME, "Leaf value");
     }
 
     protected static LeafSetNode<String> createLeafSetNode() {
         final String value = "Leaf set value";
-        final LeafSetEntryNode<String> leafSetValue = Builders.<String>leafSetEntryBuilder()
+        return Builders.<String>leafSetBuilder()
+            .withNodeIdentifier(NodeIdentifier.create(LEAF_SET_QNAME))
+            .withValue(List.of(Builders.<String>leafSetEntryBuilder()
                 .withNodeIdentifier(new NodeWithValue<>(LEAF_SET_QNAME, value))
                 .withValue(value)
-                .build();
-        return Builders.<String>leafSetBuilder()
-                .withNodeIdentifier(NodeIdentifier.create(LEAF_SET_QNAME))
-                .withValue(List.of(leafSetValue))
-                .build();
+                .build()))
+            .build();
     }
 
     protected static UserLeafSetNode<String> createUserLeafSetNode() {
index 774937453aaa615ee627fd21615497681df57cc6..5f705e16c30c76c894264ba45b492aeb12abdf00 100644 (file)
@@ -20,8 +20,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.builder.CollectionNodeBuilder;
 import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 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.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModification;
@@ -67,27 +67,26 @@ public class Bug4295Test {
 
     private void firstModification() throws DataValidationFailedException {
         /*  MERGE */
-        SystemMapNode outerListNode = ImmutableNodes.mapNodeBuilder()
-            .withNodeIdentifier(NodeIdentifier.create(outerList))
-            .withChild(createOuterListEntry("1", "o-1"))
-            .withChild(createOuterListEntry("2", "o-2"))
-            .withChild(createOuterListEntry("3", "o-3"))
-            .build();
-        ContainerNode rootContainerNode = createRootContainerBuilder()
-            .withChild(createSubRootContainerBuilder().withChild(outerListNode).build())
-            .build();
         YangInstanceIdentifier path = YangInstanceIdentifier.of(root);
         DataTreeModification modification = inMemoryDataTree.takeSnapshot().newModification();
-        modification.merge(path, rootContainerNode);
+        modification.merge(path, createRootContainerBuilder()
+            .withChild(createSubRootContainerBuilder()
+                .withChild(ImmutableNodes.mapNodeBuilder()
+                    .withNodeIdentifier(NodeIdentifier.create(outerList))
+                    .withChild(createOuterListEntry("1", "o-1"))
+                    .withChild(createOuterListEntry("2", "o-2"))
+                    .withChild(createOuterListEntry("3", "o-3"))
+                    .build())
+                .build())
+            .build());
 
         /*  WRITE INNER LIST WITH ENTRIES*/
-        SystemMapNode innerListNode = createInnerListBuilder()
-            .withChild(createInnerListEntry("a", "i-a"))
-            .withChild(createInnerListEntry("b", "i-b"))
-            .build();
         path = YangInstanceIdentifier.of(root).node(subRoot).node(outerList).node(createOuterListEntryPath("2"))
                 .node(innerList);
-        modification.write(path, innerListNode);
+        modification.write(path, createInnerListBuilder()
+            .withChild(createInnerListEntry("a", "i-a"))
+            .withChild(createInnerListEntry("b", "i-b"))
+            .build());
 
         /*  COMMIT */
         modification.ready();
@@ -97,37 +96,46 @@ public class Bug4295Test {
 
     private void secondModification(final int testScenarioNumber) throws DataValidationFailedException {
         /*  MERGE */
-        SystemMapNode outerListNode = ImmutableNodes.mapNodeBuilder()
-            .withNodeIdentifier(NodeIdentifier.create(outerList))
-            .withChild(createOuterListEntry("3", "o-3"))
-            .withChild(createOuterListEntry("4", "o-4"))
-            .withChild(createOuterListEntry("5", "o-5"))
-            .build();
-
         ContainerNode rootContainerNode = createRootContainerBuilder()
-            .withChild(createSubRootContainerBuilder().withChild(outerListNode).build())
+            .withChild(createSubRootContainerBuilder()
+                .withChild(ImmutableNodes.mapNodeBuilder()
+                    .withNodeIdentifier(NodeIdentifier.create(outerList))
+                    .withChild(createOuterListEntry("3", "o-3"))
+                    .withChild(createOuterListEntry("4", "o-4"))
+                    .withChild(createOuterListEntry("5", "o-5"))
+                    .build())
+                .build())
             .build();
 
         YangInstanceIdentifier path = YangInstanceIdentifier.of(root);
         DataTreeModification modification = inMemoryDataTree.takeSnapshot().newModification();
         modification.merge(path, rootContainerNode);
 
-        if (testScenarioNumber == 1) {
-            /* WRITE EMPTY INNER LIST */
-            writeEmptyInnerList(modification, "2");
-        } else if (testScenarioNumber == 2) {
-            /* WRITE INNER LIST ENTRY */
-            MapEntryNode innerListEntryA = createInnerListEntry("a", "i-a-2");
-            path = YangInstanceIdentifier.of(root).node(subRoot).node(outerList).node(createOuterListEntryPath("2"))
+        switch (testScenarioNumber) {
+            case 1:
+                /* WRITE EMPTY INNER LIST */
+                writeEmptyInnerList(modification, "2");
+                break;
+            case 2: {
+                /* WRITE INNER LIST ENTRY */
+                MapEntryNode innerListEntryA = createInnerListEntry("a", "i-a-2");
+                path = YangInstanceIdentifier.of(root).node(subRoot).node(outerList).node(createOuterListEntryPath("2"))
                     .node(innerList).node(createInnerListEntryPath("a"));
-            modification.write(path, innerListEntryA);
-        } else if (testScenarioNumber == 3) {
-            /* WRITE INNER LIST WITH ENTRIES */
-            SystemMapNode innerListNode = createInnerListBuilder().withChild(createInnerListEntry("a", "i-a-3"))
-                    .withChild(createInnerListEntry("c", "i-c")).build();
-            path = YangInstanceIdentifier.of(root).node(subRoot).node(outerList).node(createOuterListEntryPath("2"))
+                modification.write(path, innerListEntryA);
+                break;
+            }
+            case 3: {
+                /* WRITE INNER LIST WITH ENTRIES */
+                path = YangInstanceIdentifier.of(root).node(subRoot).node(outerList).node(createOuterListEntryPath("2"))
                     .node(innerList);
-            modification.write(path, innerListNode);
+                modification.write(path, createInnerListBuilder()
+                    .withChild(createInnerListEntry("a", "i-a-3"))
+                    .withChild(createInnerListEntry("c", "i-c"))
+                    .build());
+                break;
+            }
+            default:
+                break;
         }
 
         /*  COMMIT */
@@ -143,11 +151,11 @@ public class Bug4295Test {
     }
 
     private DataContainerNodeBuilder<NodeIdentifier, ContainerNode> createRootContainerBuilder() {
-        return ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(root));
+        return Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(root));
     }
 
     private DataContainerNodeBuilder<NodeIdentifier, ContainerNode> createSubRootContainerBuilder() {
-        return ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(subRoot));
+        return  Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(subRoot));
     }
 
     private CollectionNodeBuilder<MapEntryNode, SystemMapNode> createInnerListBuilder() {
index 182b12733df11c93c705a3d432c32f77c58c4d87..fbc63d30b88d5fb9db8ff0834ec0502814e01fc0 100644 (file)
@@ -36,10 +36,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
 import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetEntryNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
@@ -76,12 +74,14 @@ public class Bug4454Test {
     private static final YangInstanceIdentifier MIN_MAX_LEAF_LIST_PATH = YangInstanceIdentifier
             .builder(MASTER_CONTAINER_PATH).node(MIN_MAX_LEAF_LIST_QNAME).build();
 
-    private final MapEntryNode fooEntryNodeWithValue = ImmutableMapEntryNodeBuilder.create().withNodeIdentifier(
-        NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "foo"))
-            .withChild(ImmutableNodes.leafNode(MIN_MAX_VALUE_LEAF_QNAME, "footest")).build();
-    private final MapEntryNode bazEntryNodeWithValue = ImmutableMapEntryNodeBuilder.create().withNodeIdentifier(
-        NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "baz"))
-            .withChild(ImmutableNodes.leafNode(MIN_MAX_VALUE_LEAF_QNAME, "baztest")).build();
+    private final MapEntryNode fooEntryNodeWithValue = Builders.mapEntryBuilder()
+        .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "foo"))
+        .withChild(ImmutableNodes.leafNode(MIN_MAX_VALUE_LEAF_QNAME, "footest"))
+        .build();
+    private final MapEntryNode bazEntryNodeWithValue = Builders.mapEntryBuilder()
+        .withNodeIdentifier(NodeIdentifierWithPredicates.of(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME, "baz"))
+        .withChild(ImmutableNodes.leafNode(MIN_MAX_VALUE_LEAF_QNAME, "baztest"))
+        .build();
     private final MapEntryNode fooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
             "foo");
     private final MapEntryNode barEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME, MIN_MAX_KEY_LEAF_QNAME,
@@ -267,14 +267,14 @@ public class Bug4454Test {
         final NodeWithValue<?> barPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "bar");
         final NodeWithValue<?> gooPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "goo");
 
-        final LeafSetEntryNode<Object> barLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
+        final LeafSetEntryNode<Object> barLeafSetEntry = Builders.leafSetEntryBuilder()
                 .withNodeIdentifier(barPath)
                 .withValue("bar").build();
-        final LeafSetEntryNode<Object> gooLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
+        final LeafSetEntryNode<Object> gooLeafSetEntry = Builders.leafSetEntryBuilder()
                 .withNodeIdentifier(gooPath)
                 .withValue("goo").build();
 
-        final LeafSetNode<Object> fooLeafSetNode = ImmutableLeafSetNodeBuilder.create()
+        final LeafSetNode<Object> fooLeafSetNode = Builders.leafSetBuilder()
                 .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LEAF_LIST_QNAME))
                 .withChildValue("foo")
                 .build();
index 47f268b6a001cec6933ec00ff648864a8bd9c0eb..3cf7d97f173bee582259aec5afaea26fc3c6069c 100644 (file)
@@ -18,11 +18,12 @@ import java.util.Optional;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 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.tree.api.ConflictingModificationAppliedException;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
@@ -68,20 +69,17 @@ public class ConcurrentTreeModificationTest extends AbstractTestModelTest {
     }
 
     private static ContainerNode createFooTestContainerNode() {
-        return ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(
-                        mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
-                                .withChild(FOO_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(FOO_NODE).build())
+            .build();
     }
 
     private static ContainerNode createBarTestContainerNode() {
-        return ImmutableContainerNodeBuilder
-                .create()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(
-                        mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
-                                .withChild(BAR_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(BAR_NODE).build())
+            .build();
     }
 
     private static <T> T assertPresentAndType(final Optional<?> potential, final Class<T> type) {
index 62b1aabac8d475662c9fa61958ef75f888132053..c7d3cffda4a5a24d4cfd47efe7d7f727dbadbbfe 100644 (file)
@@ -8,18 +8,18 @@
 package org.opendaylight.yangtools.yang.data.tree.impl;
 
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.leafNode;
+import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntry;
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
 import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
 
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-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.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
@@ -41,12 +41,12 @@ public class ConfigStatementValidationTest extends AbstractTestModelTest {
             .builder(TestModel.OUTER_LIST_PATH).nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, TWO_ID)
             .build();
 
-    private static final MapEntryNode INNER_FOO_ENTRY_NODE = ImmutableNodes.mapEntry(TestModel.INNER_LIST_QNAME,
+    private static final MapEntryNode INNER_FOO_ENTRY_NODE = mapEntry(TestModel.INNER_LIST_QNAME,
             TestModel.NAME_QNAME, "foo");
 
-    private static final MapEntryNode INNER_BAR_ENTRY_NODE = ImmutableNodes
-            .mapEntryBuilder(QName.create(TestModel.TEST_QNAME, "inner-list2"), TestModel.NAME_QNAME, "foo")
-            .withChild(ImmutableNodes.leafNode(TestModel.VALUE_QNAME, "value")).build();
+    private static final MapEntryNode INNER_BAR_ENTRY_NODE =
+            mapEntryBuilder(QName.create(TestModel.TEST_QNAME, "inner-list2"), TestModel.NAME_QNAME, "foo")
+                .withChild(leafNode(TestModel.VALUE_QNAME, "value")).build();
 
     private static final MapEntryNode FOO_NODE = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID)
             .withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).withChild(INNER_FOO_ENTRY_NODE)
@@ -59,15 +59,15 @@ public class ConfigStatementValidationTest extends AbstractTestModelTest {
             .build();
 
     private static ContainerNode createFooTestContainerNode() {
-        return ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(FOO_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(FOO_NODE).build()).build();
     }
 
     private static ContainerNode createBarTestContainerNode() {
-        return ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(BAR_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME).withChild(BAR_NODE).build()).build();
     }
 
     @Test(expected = SchemaValidationFailedException.class)
@@ -75,9 +75,8 @@ public class ConfigStatementValidationTest extends AbstractTestModelTest {
         final DataTree inMemoryDataTree = new InMemoryDataTreeFactory().create(
             DataTreeConfiguration.DEFAULT_CONFIGURATION, SCHEMA_CONTEXT);
         final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
-        final YangInstanceIdentifier ii = OUTER_LIST_1_PATH.node(
-                new YangInstanceIdentifier.NodeIdentifier(TestModel.INNER_LIST_QNAME)).node(
-                INNER_FOO_ENTRY_NODE.getIdentifier());
+        final YangInstanceIdentifier ii = OUTER_LIST_1_PATH.node(new NodeIdentifier(TestModel.INNER_LIST_QNAME))
+            .node(INNER_FOO_ENTRY_NODE.getIdentifier());
         modificationTree.write(ii, INNER_FOO_ENTRY_NODE);
 
         inMemoryDataTree.validate(modificationTree);
@@ -113,10 +112,8 @@ public class ConfigStatementValidationTest extends AbstractTestModelTest {
     public void testOnPathCaseLeafFail() throws DataValidationFailedException {
         final DataTree inMemoryDataTree = new InMemoryDataTreeFactory().create(
             DataTreeConfiguration.DEFAULT_CONFIGURATION, SCHEMA_CONTEXT);
-        final YangInstanceIdentifier.NodeIdentifier choice1Id = new YangInstanceIdentifier.NodeIdentifier(QName.create(
-                TestModel.TEST_QNAME, "choice1"));
-        final YangInstanceIdentifier.NodeIdentifier case2ContId = new YangInstanceIdentifier.NodeIdentifier(
-                QName.create(TestModel.TEST_QNAME, "case2-cont"));
+        final NodeIdentifier choice1Id = new NodeIdentifier(QName.create(TestModel.TEST_QNAME, "choice1"));
+        final NodeIdentifier case2ContId = new NodeIdentifier(QName.create(TestModel.TEST_QNAME, "case2-cont"));
         final YangInstanceIdentifier ii = TestModel.TEST_PATH.node(choice1Id).node(case2ContId);
         final ContainerNode case2Cont = Builders.containerBuilder().withNodeIdentifier(case2ContId)
                 .withChild(leafNode(QName.create(TestModel.TEST_QNAME, "case2-leaf1"), "leaf-value")).build();
@@ -130,8 +127,7 @@ public class ConfigStatementValidationTest extends AbstractTestModelTest {
     public void testOnDataCaseLeafFail() throws DataValidationFailedException {
         final DataTree inMemoryDataTree = new InMemoryDataTreeFactory().create(
             DataTreeConfiguration.DEFAULT_CONFIGURATION, SCHEMA_CONTEXT);
-        final YangInstanceIdentifier.NodeIdentifier choice1Id = new YangInstanceIdentifier.NodeIdentifier(QName.create(
-                TestModel.TEST_QNAME, "choice1"));
+        final NodeIdentifier choice1Id = new NodeIdentifier(QName.create(TestModel.TEST_QNAME, "choice1"));
         final YangInstanceIdentifier ii = TestModel.TEST_PATH.node(choice1Id);
         final ChoiceNode choice1 = Builders.choiceBuilder().withNodeIdentifier(choice1Id)
                 .withChild(leafNode(QName.create(TestModel.TEST_QNAME, "case1-leaf1"), "leaf-value")).build();
index 2b04fb6782d39c7ab3b33b66d7f1924224790bcb..de98b9e3ffabf747659ed6dcfa45692303a5a35b 100644 (file)
@@ -19,9 +19,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 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.builder.impl.ImmutableLeafNodeBuilder;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
@@ -47,12 +46,12 @@ public class DataTreeCandidatesTest extends AbstractTestModelTest {
     public void setUp() throws Exception {
         dataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, SCHEMA_CONTEXT);
 
-        final ContainerNode testContainer = ImmutableContainerNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(ImmutableContainerNodeBuilder.create()
-                        .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
-                        .build())
-                .build();
+        final ContainerNode testContainer = Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(Builders.containerBuilder()
+                .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
+                .build())
+            .build();
 
         final InMemoryDataTreeModification modification = (InMemoryDataTreeModification) dataTree.takeSnapshot()
                 .newModification();
@@ -73,10 +72,7 @@ public class DataTreeCandidatesTest extends AbstractTestModelTest {
             .setRootPath(TestModel.INNER_CONTAINER_PATH)
             .setUniqueIndexes(true).build(), SCHEMA_CONTEXT);
 
-        final LeafNode<String> leaf = ImmutableLeafNodeBuilder.<String>create()
-                .withNodeIdentifier(new NodeIdentifier(TestModel.VALUE_QNAME))
-                .withValue("testing-value")
-                .build();
+        final LeafNode<String> leaf = ImmutableNodes.leafNode(TestModel.VALUE_QNAME, "testing-value");
 
         final DataTreeModification modification = innerDataTree.takeSnapshot().newModification();
         modification.write(TestModel.VALUE_PATH, leaf);
index 93c5298ef1b681ff9e0e1a6b074f047f310938f1..d3435f0a0bf66fbc39577c4416158c5fbb046d9d 100644 (file)
@@ -14,7 +14,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThrows;
 import static org.junit.Assert.assertTrue;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import org.junit.AfterClass;
@@ -31,19 +30,13 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithV
 import org.opendaylight.yangtools.yang.data.api.YangNetconfError;
 import org.opendaylight.yangtools.yang.data.api.YangNetconfErrorAware;
 import org.opendaylight.yangtools.yang.data.api.schema.DistinctNodeContainer;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
-import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetEntryNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListNodeBuilder;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
@@ -192,20 +185,18 @@ public class ListConstraintsValidation {
         final NodeWithValue<Object> barPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "bar");
         final NodeWithValue<Object> gooPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "goo");
 
-        final LeafSetEntryNode<Object> barLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
-                .withNodeIdentifier(barPath)
-                .withValue("bar").build();
-        final LeafSetEntryNode<Object> gooLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
-                .withNodeIdentifier(gooPath)
-                .withValue("goo").build();
-
-        final LeafSetNode<Object> fooLeafSetNode = ImmutableLeafSetNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LEAF_LIST_QNAME))
-                .withChildValue("foo").build();
-
-        modificationTree.write(MIN_MAX_LEAF_LIST_PATH, fooLeafSetNode);
-        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(barPath), barLeafSetEntry);
-        modificationTree.merge(MIN_MAX_LEAF_LIST_PATH.node(gooPath), gooLeafSetEntry);
+        modificationTree.write(MIN_MAX_LEAF_LIST_PATH, Builders.leafSetBuilder()
+            .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LEAF_LIST_QNAME))
+            .withChildValue("foo")
+            .build());
+        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(barPath), Builders.leafSetEntryBuilder()
+            .withNodeIdentifier(barPath)
+            .withValue("bar")
+            .build());
+        modificationTree.merge(MIN_MAX_LEAF_LIST_PATH.node(gooPath), Builders.leafSetEntryBuilder()
+            .withNodeIdentifier(gooPath)
+            .withValue("goo")
+            .build());
         modificationTree.delete(MIN_MAX_LEAF_LIST_PATH.node(gooPath));
         modificationTree.ready();
 
@@ -231,24 +222,22 @@ public class ListConstraintsValidation {
         final NodeWithValue<Object> gooPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "goo");
         final NodeWithValue<Object> fuuPath = new NodeWithValue<>(MIN_MAX_LIST_QNAME, "fuu");
 
-        final LeafSetEntryNode<Object> barLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
-                .withNodeIdentifier(barPath)
-                .withValue("bar").build();
-        final LeafSetEntryNode<Object> gooLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
-                .withNodeIdentifier(gooPath)
-                .withValue("goo").build();
-        final LeafSetEntryNode<Object> fuuLeafSetEntry = ImmutableLeafSetEntryNodeBuilder.create()
-                .withNodeIdentifier(fuuPath)
-                .withValue("fuu").build();
-
-        final LeafSetNode<Object> fooLeafSetNode = ImmutableLeafSetNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LEAF_LIST_QNAME))
-                .withChildValue("foo").build();
-
-        modificationTree.write(MIN_MAX_LEAF_LIST_PATH, fooLeafSetNode);
-        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(barPath), barLeafSetEntry);
-        modificationTree.merge(MIN_MAX_LEAF_LIST_PATH.node(gooPath), gooLeafSetEntry);
-        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(fuuPath), fuuLeafSetEntry);
+        modificationTree.write(MIN_MAX_LEAF_LIST_PATH, Builders.leafSetBuilder()
+            .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LEAF_LIST_QNAME))
+            .withChildValue("foo")
+            .build());
+        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(barPath), Builders.leafSetEntryBuilder()
+            .withNodeIdentifier(barPath)
+            .withValue("bar")
+            .build());
+        modificationTree.merge(MIN_MAX_LEAF_LIST_PATH.node(gooPath), Builders.leafSetEntryBuilder()
+            .withNodeIdentifier(gooPath)
+            .withValue("goo")
+            .build());
+        modificationTree.write(MIN_MAX_LEAF_LIST_PATH.node(fuuPath), Builders.leafSetEntryBuilder()
+            .withNodeIdentifier(fuuPath)
+            .withValue("fuu")
+            .build());
 
         final MinMaxElementsValidationFailedException ex = assertThrows(MinMaxElementsValidationFailedException.class,
             () -> modificationTree.ready());
@@ -262,14 +251,13 @@ public class ListConstraintsValidation {
     public void unkeyedListTestPass() throws DataValidationFailedException {
         final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
 
-        final UnkeyedListEntryNode foo = ImmutableUnkeyedListEntryNodeBuilder.create()
+        final UnkeyedListNode unkeyedListNode = Builders.unkeyedListBuilder()
+            .withNodeIdentifier(new NodeIdentifier(UNKEYED_LIST_QNAME))
+            .withValue(List.of(Builders.unkeyedListEntryBuilder()
                 .withNodeIdentifier(new NodeIdentifier(UNKEYED_LEAF_QNAME))
-                .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "foo")).build();
-        final List<UnkeyedListEntryNode> unkeyedEntries = new ArrayList<>();
-        unkeyedEntries.add(foo);
-        final UnkeyedListNode unkeyedListNode = ImmutableUnkeyedListNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(UNKEYED_LIST_QNAME))
-                .withValue(unkeyedEntries).build();
+                .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "foo"))
+                .build()))
+            .build();
 
         modificationTree.write(MASTER_CONTAINER_PATH, ImmutableNodes.containerNode(MASTER_CONTAINER_QNAME));
         modificationTree.merge(UNKEYED_LIST_PATH, unkeyedListNode);
@@ -289,20 +277,18 @@ public class ListConstraintsValidation {
     public void unkeyedListTestFail() {
         final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
 
-        final UnkeyedListEntryNode foo = ImmutableUnkeyedListEntryNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(UNKEYED_LEAF_QNAME))
-                .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "foo")).build();
-        final UnkeyedListEntryNode bar = ImmutableUnkeyedListEntryNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(UNKEYED_LEAF_QNAME))
-                .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "bar")).build();
-        final List<UnkeyedListEntryNode> unkeyedEntries = new ArrayList<>();
-        unkeyedEntries.add(foo);
-        unkeyedEntries.add(bar);
-        final UnkeyedListNode unkeyedListNode = ImmutableUnkeyedListNodeBuilder.create()
-                .withNodeIdentifier(new NodeIdentifier(UNKEYED_LIST_QNAME))
-                .withValue(unkeyedEntries).build();
-
-        modificationTree.write(UNKEYED_LIST_PATH, unkeyedListNode);
+        modificationTree.write(UNKEYED_LIST_PATH, Builders.unkeyedListBuilder()
+            .withNodeIdentifier(new NodeIdentifier(UNKEYED_LIST_QNAME))
+            .withValue(List.of(
+                Builders.unkeyedListEntryBuilder()
+                    .withNodeIdentifier(new NodeIdentifier(UNKEYED_LEAF_QNAME))
+                    .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "foo"))
+                    .build(),
+                Builders.unkeyedListEntryBuilder()
+                    .withNodeIdentifier(new NodeIdentifier(UNKEYED_LEAF_QNAME))
+                    .withChild(ImmutableNodes.leafNode(UNKEYED_LEAF_QNAME, "bar"))
+                    .build()))
+            .build());
         final MinMaxElementsValidationFailedException ex = assertThrows(MinMaxElementsValidationFailedException.class,
             () -> modificationTree.ready());
         assertEquals("(urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model?"
index 0aeaca15933f607269062eddde51fcd8346241d9..87d15a9516532285a4e08330cdf081f483358969 100644 (file)
@@ -24,8 +24,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 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.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModification;
@@ -115,22 +115,20 @@ public class ModificationMetadataTreeTest extends AbstractTestModelTest {
      *
      * @return a test document
      */
-    public NormalizedNode createDocumentOne() {
-        return ImmutableContainerNodeBuilder
-                .create()
-                .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
-                .withChild(createTestContainer()).build();
-
+    public ContainerNode createDocumentOne() {
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
+            .withChild(createTestContainer())
+            .build();
     }
 
     private static ContainerNode createTestContainer() {
-        return ImmutableContainerNodeBuilder
-                .create()
-                .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(
-                        mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
-                        .withChild(mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
-                        .withChild(BAR_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+                .withChild(mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+                .withChild(BAR_NODE).build())
+            .build();
     }
 
     @Test
index 6dffa38a9bb081a51725d5f459221a37f69cebc9..a67f74af2edd560023133c5fd30e9349d04e11b7 100644 (file)
@@ -24,9 +24,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.StoreTreeNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
 import org.opendaylight.yangtools.yang.data.tree.impl.node.TreeNode;
 import org.opendaylight.yangtools.yang.data.tree.impl.node.Version;
@@ -72,12 +71,11 @@ public class StoreTreeNodesTest extends AbstractTestModelTest {
             DataTreeConfiguration.DEFAULT_OPERATIONAL));
     }
 
-    public NormalizedNode createDocumentOne() {
-        return ImmutableContainerNodeBuilder
-                .create()
-                .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
-                .withChild(createTestContainer()).build();
-
+    public static ContainerNode createDocumentOne() {
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(SchemaContext.NAME))
+            .withChild(createTestContainer())
+            .build();
     }
 
     @Test
@@ -164,13 +162,13 @@ public class StoreTreeNodesTest extends AbstractTestModelTest {
     }
 
     private static ContainerNode createTestContainer() {
-        return ImmutableContainerNodeBuilder
-                .create()
-                .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
-                .withChild(
-                        mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
-                        .withChild(mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
-                        .withChild(BAR_NODE).build()).build();
+        return Builders.containerBuilder()
+            .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+            .withChild(mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+                .withChild(mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, ONE_ID))
+                .withChild(BAR_NODE)
+                .build())
+            .build();
     }
 
     private static <T extends TreeNode> T assertPresentAndType(final Optional<? extends TreeNode> potential,
index b78724d31c5477eb1ca7f2e4978b9a5ad137e720..dbb973c750e2d3ceb7900957dc2233f6670127a2 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.Augmentat
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 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.tree.api.DataTree;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModification;
@@ -101,9 +100,9 @@ public class YT1276Test {
                     .withChild(Builders.augmentationBuilder()
                         .withNodeIdentifier(new AugmentationIdentifier(Set.of(XYZZY_AUGMENT, XYZZY_AUGMENT_CONT)))
                         .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
-                        .withChild(ImmutableContainerNodeBuilder.create()
+                        .withChild(Builders.containerBuilder()
                             .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT))
-                            .withChild(ImmutableContainerNodeBuilder.create()
+                            .withChild(Builders.containerBuilder()
                                 .withNodeIdentifier(new NodeIdentifier(XYZZY_AUGMENT_CONT_INNER))
                                 .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
                                 .build())
@@ -184,9 +183,9 @@ public class YT1276Test {
                     .withNodeIdentifier(new NodeIdentifier(BAZ))
                     .withChild(ImmutableNodes.leafNode(XYZZY_LEAF, "xyzzy"))
                     .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
-                    .withChild(ImmutableContainerNodeBuilder.create()
+                    .withChild(Builders.containerBuilder()
                         .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT))
-                        .withChild(ImmutableContainerNodeBuilder.create()
+                        .withChild(Builders.containerBuilder()
                             .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT_INNER))
                             .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
                             .build())
@@ -206,9 +205,9 @@ public class YT1276Test {
                     .withChild(Builders.augmentationBuilder()
                         .withNodeIdentifier(new AugmentationIdentifier(Set.of(XYZZY_AUGMENT, XYZZY_AUGMENT_CONT)))
                         .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT, "xyzzy"))
-                        .withChild(ImmutableContainerNodeBuilder.create()
+                        .withChild(Builders.containerBuilder()
                             .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT))
-                            .withChild(ImmutableContainerNodeBuilder.create()
+                            .withChild(Builders.containerBuilder()
                                 .withNodeIdentifier(NodeIdentifier.create(XYZZY_AUGMENT_CONT_INNER))
                                 .withChild(ImmutableNodes.leafNode(XYZZY_AUGMENT_CONT_LEAF, "aug-cont-leaf"))
                                 .build())