Fixed failing tests due to different attribute handling in mdsal netconf northbound. 72/16272/1
authorTomas Cere <tcere@cisco.com>
Tue, 10 Mar 2015 14:49:38 +0000 (15:49 +0100)
committerTomas Cere <tcere@cisco.com>
Tue, 10 Mar 2015 15:02:09 +0000 (16:02 +0100)
Change-Id: I4f3723b9094f953307982ee25019e3736c9d24de
Signed-off-by: Tomas Cere <tcere@cisco.com>
opendaylight/netconf/mdsal-netconf-connector/src/test/java/org/opendaylight/controller/netconf/mdsal/connector/ops/NetconfMDSalMappingTest.java
opendaylight/netconf/mdsal-netconf-connector/src/test/resources/messages/mapping/editConfig_create_n1_control.xml [new file with mode: 0644]
opendaylight/netconf/mdsal-netconf-connector/src/test/resources/messages/mapping/editConfig_merge_multiple_after_replace.xml

index b5c2640..6b94251 100644 (file)
@@ -29,7 +29,6 @@ import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.custommonkey.xmlunit.examples.RecursiveElementNameAndTextQualifier;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.ConcurrentDOMDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -184,7 +183,6 @@ public class NetconfMDSalMappingTest {
 
     }
 
-    @Ignore("Xml is not similar")
     @Test
     public void testMoreComplexEditConfigs() throws Exception {
 
@@ -243,12 +241,12 @@ public class NetconfMDSalMappingTest {
         }
     }
 
-    @Ignore("Xml is not similar")
     @Test
     public void testEditWithCreate() throws Exception {
 
         verifyResponse(edit("messages/mapping/editConfig_create.xml"), RPC_REPLY_OK);
-        verifyResponse(getConfigCandidate(), XmlFileLoader.xmlFileToDocument("messages/mapping/editConfig_merge_n1_control.xml"));
+        verifyResponse(getConfigCandidate(), XmlFileLoader.xmlFileToDocument("messages/mapping/editConfig_create_n1_control.xml"));
+
 
         try {
             edit("messages/mapping/editConfig_create.xml");
@@ -301,7 +299,7 @@ public class NetconfMDSalMappingTest {
         assertEmptyDatastore(getConfigRunning());
     }
 
-    private void verifyResponse(Document response, Document template) {
+    private void verifyResponse(Document response, Document template){
         DetailedDiff dd = new DetailedDiff(new Diff(response, template));
         dd.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
         assertTrue(dd.similar());
diff --git a/opendaylight/netconf/mdsal-netconf-connector/src/test/resources/messages/mapping/editConfig_create_n1_control.xml b/opendaylight/netconf/mdsal-netconf-connector/src/test/resources/messages/mapping/editConfig_create_n1_control.xml
new file mode 100644 (file)
index 0000000..a0f4d5e
--- /dev/null
@@ -0,0 +1,18 @@
+<!--
+  ~ Copyright (c) 2015 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
+  -->
+
+<rpc-reply a="64" id="a" message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlnx="a:b:c:d">
+    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+        <mapping-nodes xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="create" xmlns="urn:opendaylight:mdsal:mapping:test">
+            <mapping-node>
+                <id>node1-put</id>
+                <content>put content</content>
+            </mapping-node>
+        </mapping-nodes>
+    </data>
+</rpc-reply>
\ No newline at end of file
index fcece32..3559330 100644 (file)
@@ -8,7 +8,7 @@
 
 <rpc-reply a="64" id="a" message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlnx="a:b:c:d">
 <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-    <mapping-nodes xmlns="urn:opendaylight:mdsal:mapping:test">
+    <mapping-nodes xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace" xmlns="urn:opendaylight:mdsal:mapping:test">
         <mapping-node>
             <id>new-node7</id>
             <content>new node content</content>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.