[Erp5-report] r30183 - /erp5/trunk/utils/erp5diff/README

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 30 18:54:14 CET 2009


Author: nicolas
Date: Fri Oct 30 18:54:13 2009
New Revision: 30183

URL: http://svn.erp5.org?rev=30183&view=rev
Log:
Update test according version 0.6 (add root element in xpath expression)

Modified:
    erp5/trunk/utils/erp5diff/README

Modified: erp5/trunk/utils/erp5diff/README
URL: http://svn.erp5.org/erp5/trunk/utils/erp5diff/README?rev=30183&r1=30182&r2=30183&view=diff
==============================================================================
--- erp5/trunk/utils/erp5diff/README [utf8] (original)
+++ erp5/trunk/utils/erp5diff/README [utf8] Fri Oct 30 18:54:13 2009
@@ -51,9 +51,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/description">description3 çsdf__sdfççç_df___&amp;amp;&amp;amp;é]]]°°°°°°</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/first_name">Tatuya</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow']/time">2009/08/28 19:12:24.703 GMT+9</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/description">description3 çsdf__sdfççç_df___&amp;amp;&amp;amp;é]]]°°°°°°</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/first_name">Tatuya</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow']/time">2009/08/28 19:12:24.703 GMT+9</xupdate:update>
   </xupdate:modifications>
 
 2. update one element
@@ -75,7 +75,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/description">description3éà@  $*&amp;lt; &amp;lt; -----</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/description">description3éà@  $*&amp;lt; &amp;lt; -----</xupdate:update>
   </xupdate:modifications>
 
 3. same
@@ -142,10 +142,10 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/description">description1 --- $sdfrç_sdfsçdf_oisfsopf</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/language/attribute::type">None</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/language"/>
-    <xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
+    <xupdate:update select="/erp5/object[@id='313730']/description">description1 --- $sdfrç_sdfsçdf_oisfsopf</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/language/attribute::type">None</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/language"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
   </xupdate:modifications>
 
 5. update two elements includes some symbols 
@@ -169,8 +169,8 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/description">description4 sdflkmooo^^^^]]]]]{{{{{{{</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/language">ca</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/description">description4 sdflkmooo^^^^]]]]]{{{{{{{</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/language">ca</xupdate:update>
   </xupdate:modifications>
 
 6. update two date element which have same id
@@ -208,8 +208,8 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/28 19:12:40.905 GMT+9</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/28 19:12:40.910 GMT+9</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/28 19:12:40.905 GMT+9</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/28 19:12:40.910 GMT+9</xupdate:update>
   </xupdate:modifications>
 
 7. insert and remove elements
@@ -239,12 +239,12 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313731']/local_role[@id='tk']"/>
-    <xupdate:append select="/object[@id='313731']" child="first()">
+    <xupdate:remove select="/erp5/object[@id='313731']/local_role[@id='tk']"/>
+    <xupdate:append select="/erp5/object[@id='313731']" child="first()">
         <xupdate:element name="local_role"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">tatuya</xupdate:attribute>&lt;?xml version="1.0"?&gt;&lt;marshal&gt;&lt;tuple&gt;&lt;string&gt;Owner&lt;/string&gt;&lt;/tuple&gt;&lt;/marshal&gt;</xupdate:element>                                                  
         <xupdate:element name="JohnDoe">Go to the beach</xupdate:element>
     </xupdate:append>
-    <xupdate:insert-before select="/object[@id='313731']/local_permission[@id='View']">
+    <xupdate:insert-before select="/erp5/object[@id='313731']/local_permission[@id='View']">
       <xupdate:element name="local_permission"><xupdate:attribute name="type">tokens</xupdate:attribute><xupdate:attribute name="id">Manage portal content</xupdate:attribute>&lt;?xml version="1.0"?&gt;</xupdate:element>
     </xupdate:insert-before>
   </xupdate:modifications>
@@ -268,7 +268,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313731']/local_permission[@id='View']">&lt;?xml version="1.0"?&gt;&lt;marshal&gt;&lt;tuple&gt;&lt;string&gt;Assignee&lt;/string&gt;&lt;string&gt;Assignor&lt;/string&gt;&lt;string&gt;Associate&lt;/string&gt;&lt;string&gt;Auditor&lt;/string&gt;&lt;string&gt;Author&lt;/string&gt;&lt;string&gt;Manager&lt;/string&gt;&lt;string&gt;Owner&lt;/string&gt;&lt;/tuple&gt;&lt;/marshal&gt;</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313731']/local_permission[@id='View']">&lt;?xml version="1.0"?&gt;&lt;marshal&gt;&lt;tuple&gt;&lt;string&gt;Assignee&lt;/string&gt;&lt;string&gt;Assignor&lt;/string&gt;&lt;string&gt;Associate&lt;/string&gt;&lt;string&gt;Auditor&lt;/string&gt;&lt;string&gt;Author&lt;/string&gt;&lt;string&gt;Manager&lt;/string&gt;&lt;string&gt;Owner&lt;/string&gt;&lt;/tuple&gt;&lt;/marshal&gt;</xupdate:update>
   </xupdate:modifications>
 
 9. rename element
@@ -292,9 +292,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313730']/first_name"/>
-    <xupdate:remove select="/object[@id='313730']/last_name"/>
-    <xupdate:append select="/object[@id='313730']" child="first()">
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/last_name"/>
+    <xupdate:append select="/erp5/object[@id='313730']" child="first()">
       <xupdate:element name="given_name"><xupdate:attribute name="type">string</xupdate:attribute>Tatuya</xupdate:element>
       <xupdate:element name="family_name"><xupdate:attribute name="type">string</xupdate:attribute>Kamada</xupdate:element>
     </xupdate:append>
@@ -321,13 +321,7 @@
 >>> erp5diff.compare(old_xml, new_xml)
 >>> erp5diff.output()
 <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-  <xupdate:rename select="/">erp6</xupdate:rename>
-  <xupdate:update select="/">
-    <object portal_type="Person" id="313730">
-    <id type="string">313730</id>
-    <title type="string">Tatuya Kamada</title>
-  </object>
-</xupdate:update>
+  <xupdate:rename select="/erp5">erp6</xupdate:rename>
 </xupdate:modifications>
 
 
@@ -350,7 +344,7 @@
 >>> erp5diff.compare(old_xml, new_xml)
 >>> erp5diff.output()
 <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-  <xupdate:update select="/object[@id='313730']/local_role[@id='fab']/attribute::type">ccc</xupdate:update>
+  <xupdate:update select="/erp5/object[@id='313730']/local_role[@id='fab']/attribute::type">ccc</xupdate:update>
 </xupdate:modifications>
 
 12. Update two attribute 
@@ -372,8 +366,8 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/local_permission[@id='View']/attribute::attr_a">ccc</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/local_permission[@id='View']/attribute::type">ccc</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/local_permission[@id='View']/attribute::attr_a">ccc</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/local_permission[@id='View']/attribute::type">ccc</xupdate:update>
   </xupdate:modifications>
 
 13. Update three attribute
@@ -395,9 +389,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/title/attribute::attribute_a">nnn</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/title/attribute::attribute_b">nnn</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/title/attribute::attribute_c">nnn</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/title/attribute::attribute_a">nnn</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/title/attribute::attribute_b">nnn</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/title/attribute::attribute_c">nnn</xupdate:update>
   </xupdate:modifications>
 
 14. Remove one attribute
@@ -419,7 +413,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_c"/>
   </xupdate:modifications>
 
 15. Remove two attribute
@@ -441,8 +435,8 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_b"/>
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_b"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_c"/>
   </xupdate:modifications>
 
 
@@ -465,9 +459,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_a"/>
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_b"/>
-    <xupdate:remove select="/object[@id='313730']/first_name/attribute::attribute_c"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_a"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_b"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/first_name/attribute::attribute_c"/>
   </xupdate:modifications>
 
 17. Append one attribute
@@ -489,7 +483,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:append select="/object[@id='313730']/last_name">
+    <xupdate:append select="/erp5/object[@id='313730']/last_name">
       <xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
     </xupdate:append>
   </xupdate:modifications>
@@ -514,7 +508,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:append select="/object[@id='313730']/last_name">
+    <xupdate:append select="/erp5/object[@id='313730']/last_name">
       <xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
       <xupdate:attribute name="attribute_b">bbb</xupdate:attribute>
     </xupdate:append>
@@ -539,7 +533,7 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:append select="/object[@id='313730']/last_name">
+    <xupdate:append select="/erp5/object[@id='313730']/last_name">
       <xupdate:attribute name="attribute_a">aaa</xupdate:attribute>
       <xupdate:attribute name="attribute_b">bbb</xupdate:attribute>
       <xupdate:attribute name="attribute_c">ccc</xupdate:attribute>
@@ -600,9 +594,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
-    <xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]"/>
-    <xupdate:remove select="/object[@id='313730']/workflow_action[@id='edit_workflow'][4]"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][3]"/>
+    <xupdate:remove select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][4]"/>
   </xupdate:modifications>
 
 21. Modify two elements that have same id
@@ -648,9 +642,9 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/29 19:12:34.432 GMT+9</xupdate:update>
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>     
-    <xupdate:update select="/object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>   
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][2]/time">2009/08/29 19:12:34.432 GMT+9</xupdate:update>
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][3]/time">2009/08/30 19:12:34.434 GMT+9</xupdate:update>     
+    <xupdate:update select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][4]/time">2009/08/31 19:12:34.436 GMT+9</xupdate:update>   
   </xupdate:modifications>
 
 22. Modify attributes of sequencial objects
@@ -688,8 +682,8 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object[2]/title">B</xupdate:update>
-    <xupdate:update select="/object[3]/title">C</xupdate:update>
+    <xupdate:update select="/erp5/object[2]/title">B</xupdate:update>
+    <xupdate:update select="/erp5/object[3]/title">C</xupdate:update>
   </xupdate:modifications>
 
 23. Modify nodes with Qualified Names
@@ -729,15 +723,15 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:remove select="/object[2]/prefixbis:title"/>
-    <xupdate:append select="/object[2]" child="first()">
+    <xupdate:remove select="/erp5/object[2]/prefixbis:title"/>
+    <xupdate:append select="/erp5/object[2]" child="first()">
       <xupdate:element name="prefix:title" namespace="http://any_uri"><xupdate:attribute name="prefix:myattr" namespace="http://any_uri">anyvalue</xupdate:attribute>B</xupdate:element>
     </xupdate:append>
-    <xupdate:remove select="/object[3]/againanotherprefix:title"/>
-    <xupdate:append select="/object[3]" child="first()">
+    <xupdate:remove select="/erp5/object[3]/againanotherprefix:title"/>
+    <xupdate:append select="/erp5/object[3]" child="first()">
       <xupdate:element name="title">A</xupdate:element>
     </xupdate:append>
-    <xupdate:insert-after select="/object[3]">
+    <xupdate:insert-after select="/erp5/object[3]">
       <xupdate:element name="erp5:object" namespace="http://www.erp5.org/namespaces/erp5_object">
         <xupdate:attribute name="portal_type">Test</xupdate:attribute>
         <title>B</title>
@@ -768,9 +762,32 @@
   >>> erp5diff.compare(old_xml, new_xml)
   >>> erp5diff.output()
   <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
-    <xupdate:update select="/object/title/attribute::prefix:attr">B</xupdate:update>
-  </xupdate:modifications>
-
+    <xupdate:update select="/erp5/object/title/attribute::prefix:attr">B</xupdate:update>
+  </xupdate:modifications>
+
+25. Modify nodes with Qualified Names at root level
+  Work on Attributes specially
+  >>> old_xml = """
+  ... <erp5:erp5 xmlns:erp5="http://www.erp5.org/namspaces/erp5_object" a="aaa" b="bbb">
+  ...   <object portal_type="Test">
+  ...     <title xmlns:prefix="http://any_uri" prefix:attr="A">A</title>
+  ...   </object>
+  ... </erp5:erp5>
+  ... """
+  >>> new_xml = """
+  ... <aaa:erp5 xmlns:aaa="http://www.erp5.org/namspaces/aaa" b="bbb" >
+  ...   <object portal_type="Test">
+  ...     <title xmlns:prefix="http://any_uri" prefix:attr="B">A</title>
+  ...   </object>
+  ... </aaa:erp5>
+  ... """
+  >>> erp5diff.compare(old_xml, new_xml)
+  >>> erp5diff.output()
+  <xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
+    <xupdate:rename select="/erp5:erp5">aaa:erp5</xupdate:rename>
+    <xupdate:remove select="/aaa:erp5/attribute::a"/>
+    <xupdate:update select="/aaa:erp5/object/title/attribute::prefix:attr">B</xupdate:update>
+  </xupdate:modifications>
 
 - 2003-12-04, Yoshinori OKUJI <yo at nexedi.com>
 - 2009-09-15, Tatuya Kamada <tatuya at nexedi.com>




More information about the Erp5-report mailing list