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/java/org/apache/commons/jxpath/ri InfoSetUtil.java
Date Fri, 29 Nov 2002 07:22:02 GMT
dmitri      2002/11/28 23:22:02

  Modified:    jxpath/src/test/org/apache/commons/jxpath/ri/model
                        XMLModelTestCase.java BeanModelTestCase.java
               jxpath/src/java/org/apache/commons/jxpath/ri
                        InfoSetUtil.java
  Log:
  Fixed the implementation of the boolean() function
  
  Revision  Changes    Path
  1.6       +19 -5     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLModelTestCase.java	29 Nov 2002 06:44:15 -0000	1.5
  +++ XMLModelTestCase.java	29 Nov 2002 07:22:01 -0000	1.6
  @@ -369,7 +369,7 @@
                   "vendor//promotion[../@stores = 'all']",
                   list(""));
       }
  -
  +    
       public void testAxisParent() {
           // parent::
           assertXPathPointer(context,
  @@ -678,4 +678,18 @@
                   "vendor/location/employeeCount and true()",
                   Boolean.TRUE);
       }
  +    
  +    public void testBooleanFunction(){
  +        assertXPathValue(context,
  +            "boolean(vendor//saleEnds[../@stores = 'all'])",
  +            Boolean.TRUE);
  +
  +        assertXPathValue(context,
  +            "boolean(vendor//promotion[../@stores = 'all'])",
  +            Boolean.TRUE);
  +
  +        assertXPathValue(context,
  +            "boolean(vendor//promotion[../@stores = 'some'])",
  +            Boolean.FALSE);
  +     }    
   }
  
  
  
  1.4       +17 -10    jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java
  
  Index: BeanModelTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BeanModelTestCase.java	26 Nov 2002 01:33:35 -0000	1.3
  +++ BeanModelTestCase.java	29 Nov 2002 07:22:01 -0000	1.4
  @@ -648,15 +648,17 @@
           assertXPathValue(context, 
               "lang('fr')", 
               Boolean.FALSE);
  -            
  -        assertXPathValueIterator(
  -            context,
  -            "beans[1]/strings[string-length() = 8]",
  -            list("String 1", "String 2", "String 3"));
  +    }
  +    
  +    public void testCoreFunctions(){
               
           assertXPathValue(context, 
               "boolean(boolean)", 
  -            Boolean.FALSE);
  +            Boolean.TRUE);
  +
  +        assertXPathValue(context,
  +            "boolean(boolean = false())",
  +            Boolean.TRUE);
               
           assertXPathValue(
               context,
  @@ -678,6 +680,11 @@
           assertXPathValue(context,
                   "beans[int > 2]/name",
                   "Name 2");
  +
  +        assertXPathValueIterator(
  +            context,
  +            "beans[1]/strings[string-length() = 8]",
  +            list("String 1", "String 2", "String 3"));
   
           // use some fancy axis and the child axis in the predicate
           assertXPathValueIterator(context,
  
  
  
  1.5       +5 -5      jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/InfoSetUtil.java
  
  Index: InfoSetUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/java/org/apache/commons/jxpath/ri/InfoSetUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InfoSetUtil.java	3 Jul 2002 21:13:06 -0000	1.4
  +++ InfoSetUtil.java	29 Nov 2002 07:22:02 -0000	1.5
  @@ -193,7 +193,7 @@
               return ((String)object).length() != 0;
           }
           else if (object instanceof NodePointer){
  -            return booleanValue(((NodePointer)object).getValue());
  +            return ((NodePointer)object).isActual();
           }
           else if (object == null){
               return false;
  
  
  

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