parentOrdinaryLeaf = QName.create(testModule, "parent-ordinary-leaf");
childOrdinaryLeaf = QName.create(testModule, "child-ordinary-leaf");
inMemoryDataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
- YangParserTestUtils.parseYangResource("/ordered-list-modification-test.yang"));
+ YangParserTestUtils.parseYang("""
+ module ordered-list-modification-test {
+ namespace "ordered-list-modification-test";
+ prefix "olmt";
+
+ container parent-container {
+ container child-container {
+ list parent-ordered-list {
+ ordered-by user;
+ key "parent-key-leaf";
+
+ leaf parent-key-leaf {
+ type string;
+ }
+ leaf parent-ordinary-leaf {
+ type string;
+ }
+
+ list child-ordered-list {
+ ordered-by user;
+ key "child-key-leaf";
+
+ leaf child-key-leaf {
+ type string;
+ }
+ leaf child-ordinary-leaf {
+ type string;
+ }
+ }
+ }
+ }
+ }
+ }"""));
}
@Test
.withChild(createChildOrderedListEntry("chkval1", "chlfval1"))
.withChild(createChildOrderedListEntry("chkval2", "chlfval2")).build();
- YangInstanceIdentifier path2 = YangInstanceIdentifier.of(parentContainer).node(childContainer)
- .node(parentOrderedList).node(createParentOrderedListEntryPath("pkval2")).node(childOrderedList);
+ YangInstanceIdentifier path2 = YangInstanceIdentifier.of(parentContainer, childContainer, parentOrderedList)
+ .node(createParentOrderedListEntryPath("pkval2")).node(childOrderedList);
treeModification.write(path2, childOrderedListNode);
treeModification.ready();