Split Restconf implementations (draft02 and RFC) - providers tests 72/62872/7
authorJakub Toth <jakub.toth@pantheon.tech>
Thu, 7 Sep 2017 22:26:11 +0000 (00:26 +0200)
committerJakub Toth <jakub.toth@pantheon.tech>
Wed, 13 Sep 2017 10:51:59 +0000 (10:51 +0000)
Change-Id: If8c26aa059508763e4730d69d9b64f594ec9e302
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
51 files changed:
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/handlers/SchemaContextHandler.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/spi/AbstractIdentifierAwareJaxRsProvider.java
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/ParameterAwareNormalizedNodeWriterDepthTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/ParameterAwareNormalizedNodeWriterDepthTest.java with 99% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/ParameterAwareNormalizedNodeWriterFieldsTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/ParameterAwareNormalizedNodeWriterFieldsTest.java with 99% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/ParameterAwareNormalizedNodeWriterParametersTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/ParameterAwareNormalizedNodeWriterParametersTest.java with 99% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/XmlBodyReaderMountPointTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/XmlBodyReaderMountPointTest.java with 95% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReaderMountPointTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/JsonPatchBodyReaderMountPointTest.java with 89% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/JsonPatchBodyReaderTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/JsonPatchBodyReaderTest.java with 88% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReaderMountPointTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/XmlPatchBodyReaderMountPointTest.java with 89% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/XmlPatchBodyReaderTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/XmlPatchBodyReaderTest.java with 88% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/test/AbstractBodyReaderTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/AbstractBodyReaderTest.java with 87% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/test/JsonBodyReaderTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/JsonBodyReaderTest.java with 96% similarity]
restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/test/XmlBodyReaderTest.java [moved from restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/restconf/jersey/providers/XmlBodyReaderTest.java with 96% similarity]
restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/foo.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/yang/foo.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/iid-value.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdata.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_choice_container.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_container.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_sub_container.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/bug7933.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_container.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_sub_container.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-augment-module.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/bar-module.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/foo-module.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang [new file with mode: 0644]
restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang [new file with mode: 0644]

index b3719b5e331e137092f80e0aff0051c46a8a3f18..6ba7018cb5d6e6d7a957a0ea3ee97e9855efb49c 100644 (file)
@@ -84,6 +84,10 @@ public class SchemaContextHandler implements SchemaContextListenerHandler {
         return actualSchemaContext;
     }
 
+    public static void setActualSchemaContext(final SchemaContext schemaContext) {
+        actualSchemaContext = schemaContext;
+    }
+
     private void putData(
             final NormalizedNode<NodeIdentifier, Collection<DataContainerChild<? extends PathArgument, ?>>> normNode) {
         final DOMDataWriteTransaction wTx = this.transactionChainHandler.get().newWriteOnlyTransaction();
index 42c2d0bee7ca538378b3d09b67708fea5d83611f..ac87d2a1e84cd89cb3286120568fe224f0aaa31d 100644 (file)
@@ -85,11 +85,11 @@ public abstract class AbstractIdentifierAwareJaxRsProvider<T> implements Message
         return HttpMethod.POST.equals(this.request.getMethod());
     }
 
-    void setUriInfo(final UriInfo uriInfo) {
+    public void setUriInfo(final UriInfo uriInfo) {
         this.uriInfo = uriInfo;
     }
 
-    void setRequest(final Request request) {
+    public void setRequest(final Request request) {
         this.request = request;
     }
 }
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -27,11 +27,13 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReader;
 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.errors.RestconfError;
+import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.XmlBodyReaderTest;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
@@ -82,8 +84,7 @@ public class XmlBodyReaderMountPointTest extends AbstractBodyReaderTest {
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mountPointService);
         when(mountPointService.getMountPoint(any(YangInstanceIdentifier.class))).thenReturn(Optional.of(mountPoint));
         when(mountPoint.getSchemaContext()).thenReturn(schemaContext);
-
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @Test
@@ -190,7 +191,7 @@ public class XmlBodyReaderMountPointTest extends AbstractBodyReaderTest {
     @Test
     public void findFooContainerUsingNamespaceTest() throws Exception {
         mockBodyReader("instance-identifier-module:cont/yang-ext:mount", this.xmlBodyReader, true);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlDataFindFooContainer.xml");
         final NormalizedNodeContext returnValue = this.xmlBodyReader
                 .readFrom(null, null, null, this.mediaType, null, inputStream);
@@ -212,7 +213,7 @@ public class XmlBodyReaderMountPointTest extends AbstractBodyReaderTest {
     @Test
     public void findBarContainerUsingNamespaceTest() throws Exception {
         mockBodyReader("instance-identifier-module:cont/yang-ext:mount", this.xmlBodyReader, true);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlDataFindBarContainer.xml");
         final NormalizedNodeContext returnValue = this.xmlBodyReader
                 .readFrom(null, null, null, this.mediaType, null, inputStream);
@@ -234,7 +235,8 @@ public class XmlBodyReaderMountPointTest extends AbstractBodyReaderTest {
     @Test
     public void wrongRootElementTest() throws Exception {
         mockBodyReader("instance-identifier-module:cont/yang-ext:mount", this.xmlBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream(
+        final InputStream inputStream =
+                XmlBodyReaderTest.class.getResourceAsStream(
                 "/instanceidentifier/xml/bug7933.xml");
         try {
             this.xmlBodyReader.readFrom(null, null, null, this.mediaType, null, inputStream);
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
 import static org.junit.Assert.assertEquals;
@@ -22,9 +22,11 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestJsonBodyReader;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.patch.PatchContext;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.JsonBodyReaderTest;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
@@ -54,8 +56,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mountPointService);
         when(mountPointService.getMountPoint(any(YangInstanceIdentifier.class))).thenReturn(Optional.of(mountPoint));
         when(mountPoint.getSchemaContext()).thenReturn(schemaContext);
-
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @Test
@@ -63,7 +64,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdata.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -79,7 +80,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -96,7 +97,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataValueMissing.json");
 
         try {
@@ -116,7 +117,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataValueNotSupported.json");
 
         try {
@@ -135,7 +136,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -151,7 +152,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHMergeOperationOnList.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -167,7 +168,7 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -183,7 +184,8 @@ public class JsonPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream =
+                JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHSimpleLeafValue.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
 import static org.junit.Assert.assertEquals;
@@ -19,9 +19,11 @@ import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestJsonBodyReader;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.patch.PatchContext;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.JsonBodyReaderTest;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
@@ -43,7 +45,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
     public static void initialization() {
         schemaContext = schemaContextLoader("/instanceidentifier/yang", schemaContext);
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @Test
@@ -51,7 +53,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdata.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -67,7 +69,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -84,7 +86,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataValueMissing.json");
 
         try {
@@ -104,7 +106,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataValueNotSupported.json");
 
         try {
@@ -123,7 +125,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -139,7 +141,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHMergeOperationOnList.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -155,7 +157,7 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream = JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -171,7 +173,8 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, jsonToPatchBodyReader, false);
 
-        final InputStream inputStream = TestJsonBodyReader.class
+        final InputStream inputStream =
+                JsonBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/jsonPATCHSimpleLeafValue.json");
 
         final PatchContext returnValue = jsonToPatchBodyReader
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
@@ -21,9 +21,11 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReader;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.patch.PatchContext;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.XmlBodyReaderTest;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
@@ -53,15 +55,14 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mountPointService);
         when(mountPointService.getMountPoint(any(YangInstanceIdentifier.class))).thenReturn(Optional.of(mountPoint));
         when(mountPoint.getSchemaContext()).thenReturn(schemaContext);
-
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @Test
     public void moduleDataTest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdata.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -75,7 +76,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void moduleDataValueMissingNegativeTest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataValueMissing.xml");
         try {
             xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
@@ -93,7 +94,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void moduleDataNotValueNotSupportedNegativeTest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml");
         try {
             xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
@@ -111,7 +112,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void moduleDataAbsoluteTargetPathTest() throws Exception {
         final String uri = MOUNT_POINT;
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -125,7 +126,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void modulePatchCompleteTargetInURITest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -139,7 +140,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void moduleDataMergeOperationOnListTest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -153,7 +154,7 @@ public class XmlPatchBodyReaderMountPointTest extends AbstractBodyReaderTest {
     public void moduleDataMergeOperationOnContainerTest() throws Exception {
         final String uri = MOUNT_POINT + "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
@@ -18,9 +18,11 @@ import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReader;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.patch.PatchContext;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.XmlBodyReaderTest;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
@@ -42,14 +44,14 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public static void initialization() {
         schemaContext = schemaContextLoader("/instanceidentifier/yang", schemaContext);
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @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
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdata.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -63,7 +65,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public void moduleDataValueMissingNegativeTest() throws Exception {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataValueMissing.xml");
         try {
             xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
@@ -81,7 +83,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public void moduleDataNotValueNotSupportedNegativeTest() throws Exception {
         final String uri = "instance-identifier-patch-module:patch-cont/my-list1=leaf1";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml");
         try {
             xmlToPatchBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
@@ -99,7 +101,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public void moduleDataAbsoluteTargetPathTest() throws Exception {
         final String uri = "";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -113,7 +115,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public void modulePatchCompleteTargetInURITest() throws Exception {
         final String uri = "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -127,7 +129,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     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
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -141,7 +143,7 @@ public class XmlPatchBodyReaderTest extends AbstractBodyReaderTest {
     public void moduleDataMergeOperationOnContainerTest() throws Exception {
         final String uri = "instance-identifier-patch-module:patch-cont";
         mockBodyReader(uri, xmlToPatchBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml");
         final PatchContext returnValue = xmlToPatchBodyReader
                 .readFrom(null, null, null, mediaType, null, inputStream);
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.test;
 
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.mock;
@@ -19,24 +19,23 @@ import javax.ws.rs.core.MultivaluedHashMap;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Request;
 import javax.ws.rs.core.UriInfo;
-import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.netconf.sal.rest.api.RestconfConstants;
-import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
-import org.opendaylight.restconf.RestConnectorProvider;
 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
 import org.opendaylight.restconf.common.patch.PatchContext;
-import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
+import org.opendaylight.restconf.nb.rfc8040.RestConnectorProvider;
+import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
+import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi.AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-abstract class AbstractBodyReaderTest {
+public abstract class AbstractBodyReaderTest {
 
-    protected static final ControllerContext CONTROLLER_CONTEXT = ControllerContext.getInstance();
     protected static final DOMMountPointServiceHandler MOUNT_POINT_SERVICE_HANDLER =
             mock(DOMMountPointServiceHandler.class);
 
     protected final MediaType mediaType;
 
-    AbstractBodyReaderTest() throws NoSuchFieldException, IllegalAccessException {
+    protected AbstractBodyReaderTest() throws NoSuchFieldException, IllegalAccessException {
         mediaType = getMediaType();
 
         final Field mountPointServiceHandlerField =
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -24,9 +24,9 @@ import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReader;
 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
+import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyReader;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
@@ -72,7 +72,6 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
     }
 
@@ -136,7 +135,8 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
                 .node(contAugmentQName);
         final String uri = "instance-identifier-module:cont";
         mockBodyReader(uri, this.jsonBodyReader, true);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream =
+                XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/json_augment_container.json");
         final NormalizedNodeContext returnValue = this.jsonBodyReader.readFrom(null, null, null, this.mediaType, null,
                 inputStream);
@@ -160,7 +160,7 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
                 .node(augmentChoice1QName).node(augChoice2II).node(augmentChoice2QName).node(containerQName);
         final String uri = "instance-identifier-module:cont";
         mockBodyReader(uri, this.jsonBodyReader, true);
-        final InputStream inputStream = TestXmlBodyReader.class
+        final InputStream inputStream = XmlBodyReaderTest.class
                 .getResourceAsStream("/instanceidentifier/json/json_augment_choice_container.json");
         final NormalizedNodeContext returnValue = this.jsonBodyReader.readFrom(null, null, null, this.mediaType, null,
                 inputStream);
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.restconf.jersey.providers;
+package org.opendaylight.restconf.nb.rfc8040.jersey.providers.test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -26,11 +26,12 @@ import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReader;
 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.errors.RestconfError;
+import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
+import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlNormalizedNodeBodyReader;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
@@ -76,8 +77,8 @@ public class XmlBodyReaderTest extends AbstractBodyReaderTest {
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         testFiles.addAll(TestRestconfUtils.loadFiles("/foo-xml-test/yang"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
+        SchemaContextHandler.setActualSchemaContext(schemaContext);
     }
 
     @Test
@@ -92,7 +93,7 @@ public class XmlBodyReaderTest extends AbstractBodyReaderTest {
 
     private void runXmlTest(final boolean isPost, final String path) throws Exception {
         mockBodyReader(path, xmlBodyReader, isPost);
-        final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream("/foo-xml-test/foo.xml");
+        final InputStream inputStream = XmlBodyReaderTest.class.getResourceAsStream("/foo-xml-test/foo.xml");
         final NormalizedNodeContext nnc = xmlBodyReader.readFrom(null, null, null, mediaType, null, inputStream);
         assertNotNull(nnc);
 
@@ -267,8 +268,8 @@ public class XmlBodyReaderTest extends AbstractBodyReaderTest {
     @Test
     public void wrongRootElementTest() throws Exception {
         mockBodyReader("instance-identifier-module:cont", this.xmlBodyReader, false);
-        final InputStream inputStream = TestXmlBodyReader.class.getResourceAsStream(
-                "/instanceidentifier/xml/bug7933.xml");
+        final InputStream inputStream =
+                XmlBodyReaderTest.class.getResourceAsStream("/instanceidentifier/xml/bug7933.xml");
         try {
             this.xmlBodyReader.readFrom(null, null, null, this.mediaType, null, inputStream);
             Assert.fail("Test should fail due to malformed PUT operation message");
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/foo.xml b/restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/foo.xml
new file mode 100644 (file)
index 0000000..96b69c4
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<top-level-list xmlns="foo">\r
+    <key-leaf>key-value</key-leaf>\r
+    <ordinary-leaf>leaf-value</ordinary-leaf>\r
+</top-level-list>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/yang/foo.yang b/restconf/restconf-nb-rfc8040/src/test/resources/foo-xml-test/yang/foo.yang
new file mode 100644 (file)
index 0000000..ceed3d9
--- /dev/null
@@ -0,0 +1,18 @@
+module foo {\r
+    namespace foo;\r
+    prefix foo;\r
+\r
+    revision 2017-08-09;\r
+\r
+    list top-level-list {\r
+        key key-leaf;\r
+\r
+        leaf key-leaf {\r
+            type string;\r
+        }\r
+\r
+        leaf ordinary-leaf {\r
+            type string;\r
+        }\r
+    }\r
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/iid-value.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/iid-value.yang
new file mode 100644 (file)
index 0000000..4e536df
--- /dev/null
@@ -0,0 +1,23 @@
+module iid-value-module {
+    namespace "iid:value:module";
+
+    prefix "iidvm";
+    revision 2016-09-12 {
+    }
+
+    container cont-iid {
+        list iid-list{
+            key "iid-leaf";
+            leaf iid-leaf{
+                type instance-identifier;
+            }
+        }
+
+        list values-iid{
+            key "value-iid";
+            leaf value-iid{
+                type string;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json
new file mode 100644 (file)
index 0000000..1483920
--- /dev/null
@@ -0,0 +1,43 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+    "patch-id" : "Test merge operation",
+    "comment" : "This is test patch for merge operation on container",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "operation": "create",
+        "target": "/",
+        "value": {
+          "patch-cont": {
+            "my-list1": [
+              {
+                "name": "my-list1 - A",
+                "my-leaf11": "I am leaf11-0",
+                "my-leaf12": "I am leaf12-1"
+              },
+              {
+                "name": "my-list1 - B",
+                "my-leaf11": "I am leaf11-0",
+                "my-leaf12": "I am leaf12-1"
+              }
+            ]
+          }
+        }
+      },
+      {
+        "edit-id": "edit2",
+        "operation": "merge",
+        "target": "/",
+        "value": {
+          "patch-cont": {
+            "my-list1": {
+              "name": "my-list1 - Merged",
+              "my-leaf11": "I am leaf11-0",
+              "my-leaf12": "I am leaf12-1"
+            }
+          }
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json
new file mode 100644 (file)
index 0000000..3b809e0
--- /dev/null
@@ -0,0 +1,32 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+    "patch-id" : "Test merge operation",
+    "comment" : "This is test patch for merge operation on list",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "operation": "replace",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "value": {
+          "my-list2": {
+            "name": "my-leaf20",
+            "my-leaf21": "I am leaf21-0",
+            "my-leaf22": "I am leaf22-0"
+          }
+        }
+      },
+      {
+        "edit-id": "edit2",
+        "operation": "merge",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf21']",
+        "value": {
+          "my-list2": {
+            "name": "my-leaf21",
+            "my-leaf21": "I am leaf21-1",
+            "my-leaf22": "I am leaf22-1"
+          }
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json
new file mode 100644 (file)
index 0000000..4a109ef
--- /dev/null
@@ -0,0 +1,17 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+
+    "patch-id" : "test-patch",
+    "comment" : "this is test patch for simple leaf value",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "operation": "replace",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']/instance-identifier-patch-module:name",
+        "value": {
+          "name": "my-leaf20"
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdata.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdata.json
new file mode 100644 (file)
index 0000000..e027a76
--- /dev/null
@@ -0,0 +1,35 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+
+    "patch-id" : "test-patch",
+    "comment" : "this is test patch",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "operation": "replace",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "value": {
+          "my-list2": {
+            "name": "my-leaf20",
+            "my-leaf21": "I am leaf21-0",
+            "my-leaf22": "I am leaf22-0"
+          }
+        }
+      },
+
+      {
+        "edit-id": "edit2",
+        "operation": "replace",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "value": {
+          "my-list2": {
+            "name": "my-leaf20",
+            "my-leaf21": "I am leaf21-1",
+            "my-leaf22": "I am leaf22-1",
+            "my-leaf-list": ["listelement"]
+          }
+        }
+      }
+    ]
+  }
+}
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json
new file mode 100644 (file)
index 0000000..1b170c7
--- /dev/null
@@ -0,0 +1,44 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+
+    "patch-id" : "test-patch",
+    "comment" : "Test to create and replace data in container directly using / sign as a target",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "operation": "create",
+        "target": "/",
+        "value": {
+          "patch-cont": {
+            "my-list1": [
+              {
+                "name": "my-list1 - A",
+                "my-leaf11": "I am leaf11-0",
+                "my-leaf12": "I am leaf12-1"
+              },
+              {
+                "name": "my-list1 - B",
+                "my-leaf11": "I am leaf11-0",
+                "my-leaf12": "I am leaf12-1"
+              }
+            ]
+          }
+        }
+      },
+      {
+        "edit-id": "edit2",
+        "operation": "replace",
+        "target": "/",
+        "value": {
+          "patch-cont": {
+            "my-list1": {
+              "name": "my-list1 - Replacing",
+              "my-leaf11": "I am leaf11-0",
+              "my-leaf12": "I am leaf12-1"
+            }
+          }
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json
new file mode 100644 (file)
index 0000000..4455038
--- /dev/null
@@ -0,0 +1,31 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+    "patch-id" : "test-patch",
+    "comment" : "this is test patch",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "value": {
+          "my-list2": [
+            {
+              "name": "my-leaf20",
+              "my-leaf21": "I am leaf20"
+            },
+            {
+              "name": "my-leaf21",
+              "my-leaf21": "I am leaf21-1",
+              "my-leaf22": "I am leaf21-2"
+            }
+          ]
+        },
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "operation": "create"
+      },
+      {
+        "edit-id": "edit2",
+        "operation": "delete",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']"
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json
new file mode 100644 (file)
index 0000000..eaf1b37
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+    "patch-id" : "test-patch",
+    "comment" : "this is test patch",
+    "edit" : [
+      {
+        "edit-id": "edit1",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "operation": "create"
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json
new file mode 100644 (file)
index 0000000..1ad52fb
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "ietf-yang-patch:yang-patch" : {
+    "patch-id" : "test-patch",
+    "comment" : "this is test patch",
+    "edit" : [
+      {
+        "edit-id": "edit2",
+        "operation": "delete",
+        "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']",
+        "value": {
+          "my-list2": [
+            {
+              "name": "my-leaf20"
+            }
+          ]
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_choice_container.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_choice_container.json
new file mode 100644 (file)
index 0000000..e64e00e
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "augment-module:case-choice-case-container1": {
+    "augment-module:case-choice-case-leaf1": "stryng"
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_container.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_augment_container.json
new file mode 100644 (file)
index 0000000..e2532f2
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "augment-module:cont-augment": {
+    "augment-module:leaf1": "stryng"
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_sub_container.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/json_sub_container.json
new file mode 100644 (file)
index 0000000..22a1d15
--- /dev/null
@@ -0,0 +1,5 @@
+{
+    "instance-identifier-module:cont1": {
+        "augment-module-leaf-list:lf11" : "/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module-leaf-list:lflst11[.=\"lflst11_1\"]"
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata.json
new file mode 100644 (file)
index 0000000..07b189d
--- /dev/null
@@ -0,0 +1,14 @@
+{
+    "instance-identifier-module:cont": {
+        "cont1": {
+            "augment-module:lst11": [
+                {
+                    "keyvalue111":"value1",
+                    "keyvalue112":"value2",
+                    "augment-augment-module:lf111":"/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module:lst11[augment-module:keyvalue111=\"value1\"][augment-module:keyvalue112=\"value2\"]/augment-augment-module:lf112",
+                    "augment-augment-module:lf112":"lf112 value"
+                }
+            ]
+        }
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json
new file mode 100644 (file)
index 0000000..63be4b9
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    "instance-identifier-module:cont": {
+        "cont1": {
+            "augment-module-leaf-list:lf11" : "/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module-leaf-list:lflst11[.=\"lflst11_1\"]"
+        }
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/bug7933.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/bug7933.xml
new file mode 100644 (file)
index 0000000..aa0d79e
--- /dev/null
@@ -0,0 +1,9 @@
+<!--
+  ~ Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<cont1 xmlns="instance:identifier:module"/>
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml
new file mode 100644 (file)
index 0000000..6523345
--- /dev/null
@@ -0,0 +1,10 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<foo-bar-container xmlns="bar:module">
+</foo-bar-container>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml
new file mode 100644 (file)
index 0000000..93aeff8
--- /dev/null
@@ -0,0 +1,10 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+
+<foo-bar-container xmlns="foo:module">
+</foo-bar-container>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml
new file mode 100644 (file)
index 0000000..d7d3a6b
--- /dev/null
@@ -0,0 +1,28 @@
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>test-patch</patch-id>
+    <comment>this is test patch</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>create</operation>
+        <target>/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf20</name>
+                <my-leaf21>I am leaf21-0</my-leaf21>
+                <my-leaf22>I am leaf22-0</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+    <edit>
+        <edit-id>edit2</edit-id>
+        <operation>create</operation>
+        <target>/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf21</name>
+                <my-leaf21>I am leaf21-1</my-leaf21>
+                <my-leaf22>I am leaf22-1</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml
new file mode 100644 (file)
index 0000000..6e84c47
--- /dev/null
@@ -0,0 +1,35 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>test-patch</patch-id>
+    <comment>Test patch with absolute target path</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>create</operation>
+        <target>/instance-identifier-patch-module:patch-cont/my-list1/leaf1/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf20</name>
+                <my-leaf21>I am leaf21-0</my-leaf21>
+                <my-leaf22>I am leaf22-0</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+    <edit>
+        <edit-id>edit2</edit-id>
+        <operation>create</operation>
+        <target>/instance-identifier-patch-module:patch-cont/my-list1/leaf1/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf21</name>
+                <my-leaf21>I am leaf21-1</my-leaf21>
+                <my-leaf22>I am leaf22-1</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml
new file mode 100644 (file)
index 0000000..23d2ce0
--- /dev/null
@@ -0,0 +1,44 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>test-patch</patch-id>
+    <comment>Test to create and replace data in container directly using / sign as a target</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>create</operation>
+        <target>/</target>
+        <value>
+            <patch-cont xmlns="instance:identifier:patch:module">
+                <my-list1>
+                    <name>my-list1 - A</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+                <my-list1>
+                    <name>my-list1 - B</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+            </patch-cont>
+        </value>
+    </edit>
+    <edit>
+        <edit-id>edit2</edit-id>
+        <operation>replace</operation>
+        <target>/</target>
+        <value>
+            <patch-cont xmlns="instance:identifier:patch:module">
+                <my-list1>
+                    <name>my-list1 - Replacing</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+            </patch-cont>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml
new file mode 100644 (file)
index 0000000..afa35bd
--- /dev/null
@@ -0,0 +1,44 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>Test merge operation</patch-id>
+    <comment>This is test patch for merge operation on container</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>create</operation>
+        <target>/</target>
+        <value>
+            <patch-cont xmlns="instance:identifier:patch:module">
+                <my-list1>
+                    <name>my-list1 - A</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+                <my-list1>
+                    <name>my-list1 - B</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+            </patch-cont>
+        </value>
+    </edit>
+    <edit>
+        <edit-id>edit2</edit-id>
+        <operation>merge</operation>
+        <target>/</target>
+        <value>
+            <patch-cont xmlns="instance:identifier:patch:module">
+                <my-list1>
+                    <name>my-list1 - Merged</name>
+                    <my-leaf11>I am leaf11-0</my-leaf11>
+                    <my-leaf12>I am leaf12-1</my-leaf12>
+                </my-list1>
+            </patch-cont>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml
new file mode 100644 (file)
index 0000000..ad13041
--- /dev/null
@@ -0,0 +1,35 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>Test merge operation</patch-id>
+    <comment>This is test patch for merge operation on list</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>replace</operation>
+        <target>/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf20</name>
+                <my-leaf21>I am leaf21-0</my-leaf21>
+                <my-leaf22>I am leaf22-0</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+    <edit>
+        <edit-id>edit2</edit-id>
+        <operation>merge</operation>
+        <target>/my-list2</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf21</name>
+                <my-leaf21>I am leaf21-1</my-leaf21>
+                <my-leaf22>I am leaf22-1</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml
new file mode 100644 (file)
index 0000000..eeec5ad
--- /dev/null
@@ -0,0 +1,16 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>test-patch</patch-id>
+    <comment>Test patch with missing value node for create operation</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>create</operation>
+        <target>/my-list2</target>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml
new file mode 100644 (file)
index 0000000..8817094
--- /dev/null
@@ -0,0 +1,23 @@
+<!--
+  ~ Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
+    <patch-id>test-patch</patch-id>
+    <comment>Test patch with not allowed value node for delete operation</comment>
+    <edit>
+        <edit-id>edit1</edit-id>
+        <operation>delete</operation>
+        <target>/my-list2/my-leaf21</target>
+        <value>
+            <my-list2 xmlns="instance:identifier:patch:module">
+                <name>my-leaf20</name>
+                <my-leaf21>I am leaf21-0</my-leaf21>
+                <my-leaf22>I am leaf22-0</my-leaf22>
+            </my-list2>
+        </value>
+    </edit>
+</yang-patch>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml
new file mode 100644 (file)
index 0000000..d73b300
--- /dev/null
@@ -0,0 +1,3 @@
+<case-choice-case-container1 xmlns="augment:module">
+    <case-choice-case-leaf1>stryng</case-choice-case-leaf1>
+</case-choice-case-container1>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_container.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_augment_container.xml
new file mode 100644 (file)
index 0000000..6b35e9e
--- /dev/null
@@ -0,0 +1,3 @@
+<cont-augment xmlns="augment:module">
+    <leaf1>stryng</leaf1>
+</cont-augment>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_sub_container.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xml_sub_container.xml
new file mode 100644 (file)
index 0000000..f76e08d
--- /dev/null
@@ -0,0 +1,6 @@
+<cont1 xmlns="instance:identifier:module">
+    <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11>
+    <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11>
+    <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11>
+    <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11>
+</cont1>
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata.xml
new file mode 100644 (file)
index 0000000..bd558fb
--- /dev/null
@@ -0,0 +1,10 @@
+<cont xmlns="instance:identifier:module">
+    <cont1>
+        <lst11 xmlns="augment:module" xmlns:c="augment:augment:module">
+            <keyvalue111>value1</keyvalue111>
+            <keyvalue112>value2</keyvalue112>
+            <lf111 xmlns="augment:augment:module" xmlns:a="instance:identifier:module" xmlns:b="augment:module" >/a:cont/a:cont1/b:lst11[b:keyvalue111="value1"][b:keyvalue112="value2"]/c:lf112</lf111>
+            <lf112 xmlns="augment:augment:module">lf112 value</lf112>
+        </lst11>
+    </cont1>
+</cont>
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml
new file mode 100644 (file)
index 0000000..00d58c2
--- /dev/null
@@ -0,0 +1,8 @@
+<cont xmlns="instance:identifier:module">
+    <cont1>
+        <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11>
+        <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11>
+        <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11>
+        <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11>
+    </cont1>
+</cont>
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-augment-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-augment-module.yang
new file mode 100644 (file)
index 0000000..3bcc93a
--- /dev/null
@@ -0,0 +1,20 @@
+module augment-augment-module {
+  namespace "augment:augment:module";
+
+  prefix "aamodule";
+
+  import augment-module {prefix amodule; revision-date 2014-01-17;}
+  import instance-identifier-module {prefix imodule; revision-date 2014-01-17;}
+
+  revision 2014-01-17 {
+  }
+
+  augment "/imodule:cont/imodule:cont1/amodule:lst11" {
+        leaf lf111 {
+            type instance-identifier;
+        }
+        leaf lf112 {
+            type string;
+        }
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang
new file mode 100644 (file)
index 0000000..f49ae65
--- /dev/null
@@ -0,0 +1,19 @@
+module augment-module-leaf-list {
+  namespace "augment:module:leaf:list";
+
+  prefix "amodulelflst";
+
+  import instance-identifier-module {prefix imodule; revision-date 2014-01-17;}
+
+  revision 2014-01-27 {
+  }
+
+    augment "/imodule:cont/imodule:cont1" {
+       leaf-list lflst11 {
+           type string;
+       }
+       leaf lf11 {
+            type instance-identifier;
+       }
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/augment-module.yang
new file mode 100644 (file)
index 0000000..f795cab
--- /dev/null
@@ -0,0 +1,63 @@
+module augment-module {
+  namespace "augment:module";
+
+  prefix "amodule";
+
+  import instance-identifier-module {prefix imodule; revision-date 2014-01-17;}
+
+  revision 2014-01-17 {
+  }
+
+  augment "/imodule:cont/imodule:cont1" {
+   list lst11 {
+       key "keyvalue111 keyvalue112";
+       leaf keyvalue111 {
+           type string;
+       }
+       leaf keyvalue112 {
+           type string;
+       }
+    }
+  }
+
+    augment "/imodule:cont" {
+      container cont-augment {
+            leaf leaf1 {
+                type string;
+            }
+        }
+    }
+
+    augment "/imodule:cont" {
+        choice augment-choice1 {
+            case case1 {
+                container case-container1 {
+                    leaf case-leaf1 {
+                        type string;
+                    }
+                }
+            }
+
+            case case2 {
+                container case-container2 {
+                    leaf case-leaf2 {
+                        type string;
+                    }
+                }
+            }
+        }
+    }
+
+    augment "/imodule:cont/augment-choice1/case1" {
+        choice augment-choice2 {
+            case case11 {
+                container case-choice-case-container1 {
+                    leaf case-choice-case-leaf1 {
+                        type string;
+                    }
+                }
+            }
+        }
+    }
+
+}
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/bar-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/bar-module.yang
new file mode 100644 (file)
index 0000000..90de085
--- /dev/null
@@ -0,0 +1,11 @@
+module bar-module {
+  namespace "bar:module";
+
+  prefix "bar-module";
+    revision 2016-09-29 {
+  }
+
+  /* This container has the same name as container in foo-module */
+  container foo-bar-container {
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/foo-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/foo-module.yang
new file mode 100644 (file)
index 0000000..16b8e7f
--- /dev/null
@@ -0,0 +1,11 @@
+module foo-module {
+  namespace "foo:module";
+
+  prefix "foo-module";
+    revision 2016-09-29 {
+  }
+
+  /* This container has the same name as container in bar-module */
+  container foo-bar-container {
+  }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang
new file mode 100644 (file)
index 0000000..ffa5db6
--- /dev/null
@@ -0,0 +1,12 @@
+module instance-identifier-module {
+  namespace "instance:identifier:module";
+
+  prefix "iimodule";
+  revision 2014-01-17 {
+  }
+
+    container cont {
+        container cont1 {
+        }
+    }
+}
\ No newline at end of file
diff --git a/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang b/restconf/restconf-nb-rfc8040/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang
new file mode 100644 (file)
index 0000000..02c1c2e
--- /dev/null
@@ -0,0 +1,47 @@
+module instance-identifier-patch-module {
+  namespace "instance:identifier:patch:module";
+
+  prefix "iipmodule";
+  revision 2015-11-21 {
+  }
+
+  container patch-cont {
+    list my-list1 {
+
+        description "PATCH /restconf/config/instance-identifier-patch-module:patch-cont/my-list1/leaf1";
+
+        key name;
+
+        leaf name {
+            type string;
+        }
+
+        leaf my-leaf11 {
+            type string;
+        }
+
+        leaf my-leaf12 {
+            type string;
+        }
+
+        list my-list2 {
+            key name;
+
+            leaf name {
+                type string;
+            }
+
+            leaf my-leaf21 {
+                type string;
+            }
+
+            leaf my-leaf22 {
+                type string;
+            }
+            leaf-list my-leaf-list {
+                type string;
+            }
+        }
+    }
+  }
+}