commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons/jxpath/src/test/org/apache/commons/jxpath Vendor.xml
Date Sun, 12 Jan 2003 05:21:51 GMT
dmitri      2003/01/11 21:21:50

  Modified:    jxpath/src/test/org/apache/commons/jxpath/ri/model
                        XMLModelTestCase.java
               jxpath/src/test/org/apache/commons/jxpath Vendor.xml
  Log:
  Making sure that the fix in >,<,>= and <= works with both beans and XML
  
  Revision  Changes    Path
  1.8       +27 -4     jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java
  
  Index: XMLModelTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLModelTestCase.java	2 Dec 2002 01:12:19 -0000	1.7
  +++ XMLModelTestCase.java	12 Jan 2003 05:21:50 -0000	1.8
  @@ -697,4 +697,27 @@
               "boolean(vendor//promotion[../@stores = 'some'])",
               Boolean.FALSE);
        }    
  +     
  +    public void testBooleanPredicateWithSearch(){
  +        
  +        assertXPathValueIterator(context,
  +            "/vendor/inventory[department/count < 10]/name",
  +            list("Watermelon")
  +        );
  +
  +        assertXPathValueIterator(context,
  +            "/vendor/inventory[department/count >= 100]/name",
  +            list("Cantaloupe")
  +        );
  +
  +        assertXPathValueIterator(context,
  +            "/vendor/inventory[department/count = 3]/name",
  +            list("Watermelon")
  +        );
  +        
  +        assertXPathValueIterator(context,
  +            "/vendor/inventory[department/count != 3]/name",
  +            list("Cantaloupe")
  +        );
  +    }     
   }
  
  
  
  1.7       +25 -0     jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/Vendor.xml
  
  Index: Vendor.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/Vendor.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Vendor.xml	29 Nov 2002 06:44:16 -0000	1.6
  +++ Vendor.xml	12 Jan 2003 05:21:50 -0000	1.7
  @@ -46,4 +46,29 @@
        <?security do not show anybody ?>
        <?report average only ?>
     </product>
  +
  +  <inventory>
  +    <name>Watermelon</name>
  +    <department>
  +      <name>Fruit</name>
  +      <count>20</count>
  +    </department>
  +    <department>
  +      <name>Vegetables</name>
  +      <count>3</count>
  +    </department>
  +  </inventory>
  +
  +  <inventory>
  +    <name>Cantaloupe</name>
  +    <department>
  +      <name>Fruit</name>
  +      <count>10</count>
  +    </department>
  +    <department>
  +      <name>Vegetables</name>
  +      <count>100</count>
  +    </department>
  +  </inventory>
  +
   </vendor>
  
  
  

--
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