use of org.opendaylight.restconf.common.patch.PatchContext in project netconf by opendaylight.
the class TestJsonPatchBodyReader method modulePatchMergeOperationOnContainerTest.
/**
* Test of Yang Patch merge operation on container. Test consists of two edit operations - create and merge.
*/
@Test
public void modulePatchMergeOperationOnContainerTest() throws Exception {
final String uri = "instance-identifier-patch-module:patch-cont";
mockBodyReader(uri, jsonToPatchBodyReader, false);
final InputStream inputStream = TestJsonBodyReader.class.getResourceAsStream("/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json");
final PatchContext returnValue = jsonToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
checkPatchContext(returnValue);
}
use of org.opendaylight.restconf.common.patch.PatchContext in project netconf by opendaylight.
the class TestJsonPatchBodyReaderMountPoint method modulePatchSimpleLeafValueTest.
/**
* Test reading simple leaf value.
*/
@Test
public void modulePatchSimpleLeafValueTest() throws Exception {
final String uri = MOUNT_POINT + "/instance-identifier-patch-module:patch-cont/my-list1/leaf1";
mockBodyReader(uri, jsonToPatchBodyReader, false);
final InputStream inputStream = TestJsonBodyReader.class.getResourceAsStream("/instanceidentifier/json/jsonPATCHSimpleLeafValue.json");
final PatchContext returnValue = jsonToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
checkPatchContext(returnValue);
}
use of org.opendaylight.restconf.common.patch.PatchContext in project netconf by opendaylight.
the class TestXmlPatchBodyReader method modulePatchCompleteTargetInURITest.
/**
* Test using Patch when target is completely specified in request URI and thus target leaf contains only '/' sign.
*/
@Test
public void modulePatchCompleteTargetInURITest() throws Exception {
final String uri = "instance-identifier-patch-module:patch-cont";
mockBodyReader(uri, xmlToPatchBodyReader, false);
final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml");
final PatchContext returnValue = xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
checkPatchContext(returnValue);
}
use of org.opendaylight.restconf.common.patch.PatchContext in project netconf by opendaylight.
the class TestXmlPatchBodyReader method moduleDataTest.
@Test
public void moduleDataTest() throws Exception {
final String uri = "instance-identifier-patch-module:patch-cont/my-list1/leaf1";
mockBodyReader(uri, xmlToPatchBodyReader, false);
final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream("/instanceidentifier/xml/xmlPATCHdata.xml");
final PatchContext returnValue = xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
checkPatchContext(returnValue);
}
use of org.opendaylight.restconf.common.patch.PatchContext in project netconf by opendaylight.
the class TestXmlPatchBodyReader method moduleDataMergeOperationOnListTest.
/**
* Test of Yang Patch merge operation on list. Test consists of two edit operations - replace and merge.
*/
@Test
public void moduleDataMergeOperationOnListTest() throws Exception {
final String uri = "instance-identifier-patch-module:patch-cont/my-list1/leaf1";
mockBodyReader(uri, xmlToPatchBodyReader, false);
final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml");
final PatchContext returnValue = xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
checkPatchContext(returnValue);
}
Aggregations