directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r493597 - in /directory/branches/shared/0.9.5/ldap/src: main/antlr/filter-parser.g test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
Date Sat, 06 Jan 2007 23:42:25 GMT
Author: seelmann
Date: Sat Jan  6 15:42:24 2007
New Revision: 493597

URL: http://svn.apache.org/viewvc?view=rev&rev=493597
Log:
Fix for DIRSERVER-813, added test

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/antlr/filter-parser.g
    directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/antlr/filter-parser.g
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/antlr/filter-parser.g?view=diff&rev=493597&r1=493596&r2=493597
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/antlr/filter-parser.g (original)
+++ directory/branches/shared/0.9.5/ldap/src/main/antlr/filter-parser.g Sat Jan  6 15:42:24
2007
@@ -181,7 +181,7 @@
       {
           children.add( child );
       }
-    )+
+    )*
     {
         node = new BranchNode( AbstractExprNode.AND, children );
     }
@@ -206,7 +206,7 @@
       {
           children.add( child );
       }
-    )+
+    )*
     {
         node = new BranchNode( AbstractExprNode.OR, children );
     }

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java?view=diff&rev=493597&r1=493596&r2=493597
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserImplTest.java
Sat Jan  6 15:42:24 2007
@@ -75,10 +75,26 @@
     }
 
 
+    public void testAndFilterOneChildOnly() throws IOException, ParseException
+    {
+        BranchNode node = ( BranchNode ) parser.parse( "(& ( ou ~= people ) ) " );
+        assertEquals( 1, node.getChildren().size() );
+        assertEquals( AbstractExprNode.AND, node.getOperator() );
+    }
+
+
     public void testOrFilter() throws IOException, ParseException
     {
         BranchNode node = ( BranchNode ) parser.parse( "(| ( ou ~= people ) (age>=30)
) " );
         assertEquals( 2, node.getChildren().size() );
+        assertEquals( AbstractExprNode.OR, node.getOperator() );
+    }
+
+
+    public void testOrFilterOneChildOnly() throws IOException, ParseException
+    {
+        BranchNode node = ( BranchNode ) parser.parse( "(| (age>=30) ) " );
+        assertEquals( 1, node.getChildren().size() );
         assertEquals( AbstractExprNode.OR, node.getOperator() );
     }
 



Mime
View raw message