directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r770988 - in /directory/apacheds/trunk: core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
Date Sat, 02 May 2009 22:19:13 GMT
Author: elecharny
Date: Sat May  2 22:19:13 2009
New Revision: 770988

URL: http://svn.apache.org/viewvc?rev=770988&view=rev
Log:
Another fix for DIRSERVER-1333. The first two fixes were not enough.

Modified:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java?rev=770988&r1=770987&r2=770988&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
Sat May  2 22:19:13 2009
@@ -1709,6 +1709,14 @@
        sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
                AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
        
+       // Create an entry which does not match
+       Attributes attrs = new BasicAttributes( "objectClass", "top", true );
+       attrs.get( "objectClass" ).add( "groupOfUniqueNames" );
+       attrs.put( "cn", "testGroup3" );
+       attrs.put( "uniqueMember", "uid=admin,ou=system" );
+       getSystemContext( service ).createSubcontext( "cn=testGroup3,ou=groups", attrs );
+       
+       
        HashMap<String, Attributes> map = new HashMap<String, Attributes>();
        String filter = "(|(&(|(2.5.4.0=posixgroup)(2.5.4.0=groupofuniquenames)(2.5.4.0=groupofnames)(2.5.4.0=group))(!(|(2.5.4.50=uid=admin,ou=system)(2.5.4.31=0.9.2342.19200300.100.1.1=admin,2.5.4.11=system))))(objectClass=referral))";
        NamingEnumeration<SearchResult> list = sysRoot.search( "", filter, controls
);
@@ -1719,7 +1727,12 @@
            map.put( result.getName(), result.getAttributes() );
        }
        
-       assertEquals( "size of results", 1, map.size() );
-       assertTrue( "contains cn=Administrators,ou=groups,ou=system", map.containsKey( "cn=Administrators,ou=groups,ou=system"
) ); 
+       assertEquals( "size of results", 5, map.size() );
+       assertTrue( map.containsKey( "cn=testGroup0,ou=groups,ou=system" ) ); 
+       assertTrue( map.containsKey( "cn=testGroup1,ou=groups,ou=system" ) ); 
+       assertTrue( map.containsKey( "cn=testGroup2,ou=groups,ou=system" ) ); 
+       assertTrue( map.containsKey( "cn=testGroup4,ou=groups,ou=system" ) ); 
+       assertTrue( map.containsKey( "cn=testGroup5,ou=groups,ou=system" ) ); 
+       assertFalse( map.containsKey( "cn=testGroup3,ou=groups,ou=system" ) ); 
    }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java?rev=770988&r1=770987&r2=770988&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizingVisitor.java
Sat May  2 22:19:13 2009
@@ -387,9 +387,16 @@
 
             ExprNode result = ( ExprNode ) visit( child );
 
-            if ( ( result == null ) || ( result instanceof BranchNode ) )
+            if ( result == null )
             {
-                return result;
+                return null;
+            }
+            else if ( result instanceof BranchNode )
+            {
+                List<ExprNode> newChildren = new ArrayList<ExprNode>( 1 );
+                newChildren.add( result );
+                node.setChildren( newChildren );
+                return node;
             }
             else if ( result instanceof LeafNode )
             {



Mime
View raw message