directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r512197 - in /directory/apacheds/branches/1.0: core-unit/src/test/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ core/src/main/java/org/apache/directory/server/core/schema/
Date Tue, 27 Feb 2007 09:49:49 GMT
Author: akarasulu
Date: Tue Feb 27 01:49:49 2007
New Revision: 512197

URL: http://svn.apache.org/viewvc?view=rev&rev=512197
Log:
fix for DIRSERVER-859

Modified:
    directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
    directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
    directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java

Modified: directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java?view=diff&rev=512197&r1=512196&r2=512197
==============================================================================
--- directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
(original)
+++ directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/SearchOpsITest.java
Tue Feb 27 01:49:49 2007
@@ -97,6 +97,7 @@
         addNisPosixGroup( "testGroup0", 0 );
         addNisPosixGroup( "testGroup1", 1 );
         addNisPosixGroup( "testGroup2", 2 );
+        // --- skip group 3 ---
         addNisPosixGroup( "testGroup4", 4 );
         addNisPosixGroup( "testGroup5", 5 );
     }
@@ -288,5 +289,17 @@
         assertFalse( results.contains( "cn=testGroup3,ou=groups,ou=system" ) );
         assertFalse( results.contains( "cn=testGroup4,ou=groups,ou=system" ) );
         assertFalse( results.contains( "cn=testGroup5,ou=groups,ou=system" ) );
+    }
+    
+    
+    public void testNotOperator() throws NamingException
+    {
+        Set results = searchGroups( "(!(gidNumber=4))" );
+        assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
+        assertFalse( results.contains( "cn=testGroup3,ou=groups,ou=system" ) );
+        assertFalse( results.contains( "cn=testGroup4,ou=groups,ou=system" ) );
+        assertTrue( results.contains( "cn=testGroup5,ou=groups,ou=system" ) );
     }
 }

Modified: directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?view=diff&rev=512197&r1=512196&r2=512197
==============================================================================
--- directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
(original)
+++ directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
Tue Feb 27 01:49:49 2007
@@ -216,8 +216,14 @@
             && !( onlyChild instanceof PresenceNode ) )
         {
             LeafNode leaf = ( LeafNode ) onlyChild;
-            Index idx = db.getUserIndex( leaf.getAttribute() );
-            return BigInteger.valueOf( idx.count() );
+            
+            if ( db.hasUserIndexOn( leaf.getAttribute() ) )
+            {
+                Index idx = db.getUserIndex( leaf.getAttribute() );
+                return BigInteger.valueOf( idx.count() );
+            }
+
+            return BigInteger.valueOf( db.count() );
         }
 
         return BigInteger.valueOf( db.count() );

Modified: directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java?view=diff&rev=512197&r1=512196&r2=512197
==============================================================================
--- directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
(original)
+++ directory/apacheds/branches/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
Tue Feb 27 01:49:49 2007
@@ -238,29 +238,28 @@
     public String getPrimaryName( String oid ) throws NamingException
     {
         Object value = byOid.get( oid );
+        
+        if ( null == value )
+        {
+            value = bootstrap.getPrimaryName( oid );
+        }
 
         if ( null == value )
         {
             String msg = "OID '" + oid + "' was not found within the OID registry";
-
             NamingException fault = new NamingException( msg );
-
             monitor.oidDoesNotExist( oid, fault );
-
             throw fault;
         }
 
         if ( value instanceof String )
         {
             monitor.nameResolved( oid, ( String ) value );
-
             return ( String ) value;
         }
 
         String name = ( String ) ( ( List ) value ).get( 0 );
-
         monitor.nameResolved( oid, name );
-
         return name;
     }
 



Mime
View raw message