import org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeProvider;
import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
import org.opendaylight.controller.sal.restconf.impl.test.YangAndXmlAndDataSchemaLoader;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.Node;
public class CnSnToJsonWithAugmentTest extends YangAndXmlAndDataSchemaLoader {
}
/**
- * Test of json output when as input are specified composite node with empty
- * data + YANG file
+ * Test of json output when as input are specified composite node with empty data + YANG file
*/
@Test
public void augmentedElementsToJson() {
- CompositeNode compositeNode = TestUtils.readInputToCnSn("/cnsn-to-json/augmentation/xml/data.xml",
+ Node<?> node = TestUtils.readInputToCnSn("/cnsn-to-json/augmentation/xml/data.xml",
XmlToCompositeNodeProvider.INSTANCE);
- TestUtils.normalizeCompositeNode(compositeNode, modules, searchedModuleName + ":" + searchedDataSchemaName);
+ TestUtils.normalizeCompositeNode(node, modules, searchedModuleName + ":" + searchedDataSchemaName);
String jsonOutput = null;
try {
- jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(compositeNode, modules, dataSchemaNode,
+ jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(node, modules, dataSchemaNode,
StructuredDataToJsonProvider.INSTANCE);
} catch (WebApplicationException | IOException e) {
}
assertNotNull(jsonOutput);
- assertTrue(containsStringData(jsonOutput,"\"augment-leaf:lf2\"",":", "\"lf2\""));
- assertTrue(containsStringData(jsonOutput,"\"augment-container:cont1\"",":", "\\{"));
- assertTrue(containsStringData(jsonOutput,"\"augment-container:lf11\"",":", "\"lf11\""));
- assertTrue(containsStringData(jsonOutput,"\"augment-list:lst1\"",":", "\\["));
- assertTrue(containsStringData(jsonOutput,"\"augment-list:lf11\"",":", "\"lf1_1\""));
- assertTrue(containsStringData(jsonOutput,"\"augment-list:lf11\"",":", "\"lf1_2\""));
- assertTrue(containsStringData(jsonOutput,"\"augment-leaflist:lflst1\"",":", "\\["));
+ assertTrue(containsStringData(jsonOutput, "\"augment-leaf:lf2\"", ":", "\"lf2\""));
+ assertTrue(containsStringData(jsonOutput, "\"augment-container:cont1\"", ":", "\\{"));
+ assertTrue(containsStringData(jsonOutput, "\"augment-container:lf11\"", ":", "\"lf11\""));
+ assertTrue(containsStringData(jsonOutput, "\"augment-list:lst1\"", ":", "\\["));
+ assertTrue(containsStringData(jsonOutput, "\"augment-list:lf11\"", ":", "\"lf1_1\""));
+ assertTrue(containsStringData(jsonOutput, "\"augment-list:lf11\"", ":", "\"lf1_2\""));
+ assertTrue(containsStringData(jsonOutput, "\"augment-leaflist:lflst1\"", ":", "\\["));
}
}