commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/latka/src/distribution/tests/latka-self-test TestLatkaOptional.xml
Date Thu, 02 May 2002 22:26:21 GMT
morgand     02/05/02 15:26:21

  Added:       latka/src/distribution/tests/latka-self-test
                        TestLatkaOptional.xml
  Log:
  functional tests for optional latka tags (currently just the xpath tag)
  
  Revision  Changes    Path
  1.1                  jakarta-commons/latka/src/distribution/tests/latka-self-test/TestLatkaOptional.xml
  
  Index: TestLatkaOptional.xml
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE suite SYSTEM "../../conf/suite.dtd">
  <suite defaultHost="${defaultHost}" defaultPort="${defaultPort}" 
      label="Latka self-diagnostics for optional taks">
  
    <!-- START XPATH TESTS -->
    
    <request path="${latkaContext}/self-test/xpath/TestMeWithXPath.xml">
        <validate>
          <xpath select="doc/element" label="test for existence of first element"/>
          <!-- misspellings are false -->
          <xpath select="doc/elemente" label="test for missing node" cond="false"/>
          <xpath select="doc/element/@attribute = 'foo'" label="boolean xpath att true
1"/>
          <!-- also true, the second 'element' element -->
          <xpath select="doc/element/@attribute = 'bar'" label="boolean xpath att true
2"/>
          <xpath select="doc/element/@attribute = 'bara'" cond="false" 
              label="boolean xpath att false"/>
          <xpath select="doc/element2/@attribute = 'foo'" label="boolean xpath element2
att"/>
          
          <!-- alternate syntax -->   
          <xpath select="string(doc/element/@attribute)" value="foo" label="value test
true 1"/>
          <!-- only the first element's attribute counts -->
          <xpath select="string(doc/element/@attribute)" value="bar" cond="false" 
              label="value test true 1"/>
          <xpath select="string(doc/element2/@attribute)" value="foo" label="value test
true 2"/>
          
          <!-- are attributes supposed to fail like this? -->
          <xpath select="doc/element/@attribute" value="foo" cond="false"
              label="value test true 1"/>
          <xpath select="doc/element2/@attribute" value="foo" cond="false"
              label="boolean xpath element2 att"/>
          
          <!-- now boolean tests -->
          <xpath select="count(doc/element) = 2" label="element count"/>
          <xpath select="count(doc/element) = 3" cond="false"
              label="element count false"/>
          
        </validate>
    </request>
    
    <!-- END XPATH TESTS -->
  
  </suite>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message