Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 89417 invoked from network); 2 Dec 2004 07:20:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 07:20:30 -0000 Received: (qmail 93045 invoked by uid 500); 2 Dec 2004 07:20:29 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 93010 invoked by uid 500); 2 Dec 2004 07:20:29 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 92996 invoked by uid 99); 2 Dec 2004 07:20:29 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 01 Dec 2004 23:20:28 -0800 Received: (qmail 89340 invoked by uid 65534); 2 Dec 2004 07:20:27 -0000 Date: 2 Dec 2004 07:20:27 -0000 Message-ID: <20041202072027.89331.qmail@minotaur.apache.org> From: akarasulu@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: r109463 - /incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g /incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Wed Dec 1 23:20:26 2004 New Revision: 109463 URL: http://svn.apache.org/viewcvs?view=rev&rev=109463 Log: Changes ... o captured failed situation from JIRA issue in test case where we had the following substring pattern *any* o made changes to parser grammar to recognize situations where the initial and final values are null; so this would work with *any* or *any*any* etc Notes ... This was a fix to the following JIRA issue filed by Enrique Rodriguez: http://nagoya.apache.org/jira/browse/DIRLDAP-21 Modified: incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java Modified: incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g Url: http://svn.apache.org/viewcvs/incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g?view=diff&rev=109463&p1=incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g&r1=109462&p2=incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g&r2=109463 ============================================================================== --- incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g (original) +++ incubator/directory/ldap/trunk/common/src/antlr/filter-value-parser.g Wed Dec 1 23:20:26 2004 @@ -194,7 +194,15 @@ fin = alt2.getText().trim(); } - )+ + )+ ( ASTERISK + { + if ( fin != null && fin.length() > 0 ) + { + any.add( fin ); + } + + fin = null; + })? | // A L T E R N A T I V E 3: initial (*any) *final alt3t0:VALUEENCODING Modified: incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java Url: http://svn.apache.org/viewcvs/incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java?view=diff&rev=109463&p1=incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java&r1=109462&p2=incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java&r2=109463 ============================================================================== --- incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java (original) +++ incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/filter/FilterParserImplTest.java Wed Dec 1 23:20:26 2004 @@ -556,6 +556,24 @@ } + /** + * Enrique just found this bug with the filter parser when parsing substring + * expressions like *any*. Here's the JIRA issue: + * DIRLDAP-21. + */ + public void testSubstringStarAnyStar() throws IOException, ParseException + { + SubstringNode node = ( SubstringNode ) parser.parse( "( ou =*foo*)" ); + assertEquals( "ou", node.getAttribute() ); + assertEquals( AbstractExprNode.SUBSTRING, node.getAssertionType() ); + + assertEquals( 1, node.getAny().size() ); + assertTrue( node.getAny().contains( "foo" ) ); + assertNull( node.getInitial() ); + assertNull( node.getFinal() ); + } + + /* @todo look at custom error handlers for the parser */ /////// Causes parser to hang rather than really bombing out. Looks like /////// we may need to implement a custom error handler for this parser.