- @Test
- public void testXmlLeafrefToCnSn() {
- CompositeNode compositeNode = TestUtils.readInputToCnSn("/xml-to-cnsn/leafref/xml/data.xml", false,
- XmlToCompositeNodeProvider.INSTANCE);
- assertNotNull(compositeNode);
- assertNotNull(dataSchemaNode);
- TestUtils.normalizeCompositeNode(compositeNode, modules, schemaNodePath);
-
- assertEquals("cont", compositeNode.getNodeType().getLocalName());
-
- SimpleNode<?> lf2 = null;
- for (Node<?> childNode : compositeNode.getValue()) {
- if (childNode instanceof SimpleNode) {
- if (childNode.getNodeType().getLocalName().equals("lf2")) {
- lf2 = (SimpleNode<?>) childNode;
- break;
- }
- }
- }
-
- assertNotNull(lf2);
- assertTrue(lf2.getValue() instanceof String);
- assertEquals("121", lf2.getValue());
- }
-