You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dm...@apache.org on 2004/01/24 03:16:51 UTC

cvs commit: jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/compiler TestFunctions.java ExtensionFunctionTest.java

dmitri      2004/01/23 18:16:51

  Modified:    jxpath/src/test/org/apache/commons/jxpath/ri/compiler
                        TestFunctions.java ExtensionFunctionTest.java
  Log:
  Fixed a problem with passing collections as arguments and using getNodeSet in general
  
  Revision  Changes    Path
  1.8       +8 -4      jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/compiler/TestFunctions.java
  
  Index: TestFunctions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/compiler/TestFunctions.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestFunctions.java	9 Oct 2003 21:31:43 -0000	1.7
  +++ TestFunctions.java	24 Jan 2004 02:16:51 -0000	1.8
  @@ -185,4 +185,8 @@
           
           return set;
       }
  +    
  +    public static Collection items(Collection arg) {
  +        return arg;
  +    }
   }
  
  
  
  1.12      +13 -5     jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/compiler/ExtensionFunctionTest.java
  
  Index: ExtensionFunctionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jxpath/src/test/org/apache/commons/jxpath/ri/compiler/ExtensionFunctionTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ExtensionFunctionTest.java	19 Jan 2004 20:44:52 -0000	1.11
  +++ ExtensionFunctionTest.java	24 Jan 2004 02:16:51 -0000	1.12
  @@ -353,7 +353,15 @@
           assertXPathValue(
               context,
               "test:collection()/@name",
  -            "foo");        
  +            "foo");   
  +        
  +        List list = new ArrayList();
  +        list.add("foo");
  +        list.add("bar");
  +        context.getVariables().declareVariable("myList", list); 
  +        Object
  +        values = context.getValue("test:items($myList)");
  +        System.err.println("Values: " + values);
       }
   
       public void testNodeSetReturn() {
  
  
  

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