CVS Update: xmlpull-api-v1/src/xml/tests

Aleksander Andrzej Slominski <[email protected]>
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
aslom       02/07/31 16:33:26

  Added:       src/xml/tests cdsect.xml simple.xml typical.xml
  Log:
  added some simple XML tests
  
  Revision  Changes    Path
  1.1                  xmlpull-api-v1/src/xml/tests/cdsect.xml
  
  Index: cdsect.xml
  ===================================================================
  <tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
  
  <!-- this initial test for CDATA handling -->
   <test-parser name="CDSECT handling">
    <create-parser/>
    <input-inline>&lt;foo>
  &lt;t> &lt;![CDATA[fo]]&gt;o&lt;![CDATA[ ]]&gt;&lt;/t>
  &lt;/foo> </input-inline>
    <set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
    <expect type="START_DOCUMENT"/>
    <next/>
    <expect type="START_TAG" namespace="" name="foo" empty="false"/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
    <expect type="END_TAG" namespace="" name="t" />
  
    <next-tag/>
    <expect type="END_TAG" namespace="" name="foo" />
    <next/>
    <expect type="END_DOCUMENT"/>
   </test-parser>
  
  
  
  
  
  <!-- now more of complex tests -->
  
   <test-parser name="more CDSECT handling">
    <create-parser/>
    <input-inline>&lt;foo>
  &lt;t>&lt;![CDATA[ foo]]&gt; &lt;/t>
  &lt;t>&lt;![CDATA[ foo ]]&gt;&lt;/t>
  &lt;t> &lt;![CDATA[foo ]]&gt;&lt;/t>
  &lt;t>&lt;![CDATA[ foo]]&gt; &lt;/t>
  &lt;t> &lt;![CDATA[foo]]&gt; &lt;/t>
  &lt;t> &lt;![CDATA[fo]]&gt;&lt;![CDATA[o]]&gt; &lt;/t>
  &lt;t> &lt;![CDATA[fo]]&gt;o&lt;![CDATA[ ]]&gt;&lt;/t>
  &lt;t> &lt;![CDATA[f]]&gt;o&lt;![CDATA[o]]&gt; &lt;/t>
  &lt;t>&lt;![CDATA[ f]]&gt;o&lt;![CDATA[o ]]&gt;&lt;/t>
  &lt;/foo> </input-inline>
    <set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
    <expect type="START_DOCUMENT"/>
    <next/>
    <expect type="START_TAG" namespace="" name="foo" empty="false"/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="START_TAG" namespace="" name="t"/>
    <next-text text=" foo "/>
  
    <next-tag/>
    <expect type="END_TAG" namespace="" name="foo" />
    <next/>
    <expect type="END_DOCUMENT"/>
   </test-parser>
  
  </tests>
  
  
  
  
  1.1                  xmlpull-api-v1/src/xml/tests/simple.xml
  
  Index: simple.xml
  ===================================================================
  <tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
   <test-parser name="initial test">
    <create-parser/> <input-inline><![CDATA[ <foo>bar</foo> ]]></input-inline>
    <set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
    <expect type="START_DOCUMENT"/>
    <next/><expect type="START_TAG" namespace="" name="foo" empty="false"/>
    <next-text text="bar"/>
    <next/><expect type="END_DOCUMENT"/>
   </test-parser>
  </tests>
  
  
  <!--tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
   <test-parser name="initial test">
    <create-parser/>
    <input-inline><![CDATA[ <foo></foo> ]]></input-inline>
    <set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
    <expect type="START_DOCUMENT"/>
    <next/>   <!-- instead of: <execute method="next()"/> ->
    <expect type="START_TAG" namespace="" name="foo" empty="false"/>
      <!-- instead of:  <execute method="isEmptyElement()" into="t1" />
      <assertVar name="t1" value="true" /> ->
    <next/>
    <expect type="END_TAG" namespace="" name="foo" />
    <next/>
    <expect type="END_DOCUMENT"/>
   </test-parser>
  </tests-->
  
  
  
  
  1.1                  xmlpull-api-v1/src/xml/tests/typical.xml
  
  Index: typical.xml
  ===================================================================
  <tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
   <test-parser name="typical XML">
    <create-parser/> <input-inline><![CDATA[ <foo>bar&amp;baz</foo> ]]></input-inline>
    <set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
    <expect type="START_DOCUMENT"/>
    <next/><expect type="START_TAG" namespace="" name="foo" empty="false"/>
    <next-text text="bar&amp;baz"/>
    <next/><expect type="END_DOCUMENT"/>
   </test-parser>
  </tests>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.