directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r413929 - in /directory/branches/apacheds/optimization: core/src/main/java/org/apache/directory/server/core/event/EventService.java server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
Date Tue, 13 Jun 2006 16:16:24 GMT
Author: akarasulu
Date: Tue Jun 13 09:16:24 2006
New Revision: 413929

URL: http://svn.apache.org/viewvc?rev=413929&view=rev
Log:
fixing normalization issues with persistent search mechanism

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/event/EventService.java
    directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/event/EventService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/event/EventService.java?rev=413929&r1=413928&r2=413929&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/event/EventService.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/event/EventService.java
Tue Jun 13 09:16:24 2006
@@ -168,6 +168,7 @@
             List list = new ArrayList();
             list.add( obj );
             list.add( rec );
+            sources.put( namingListener, list );
         }
         else if ( obj instanceof List )
         {
@@ -257,7 +258,7 @@
             if ( listener instanceof NamespaceChangeListener )
             {
                 NamespaceChangeListener nclistener = ( NamespaceChangeListener ) listener;
-                Binding binding = new Binding( name.toString(), entry, false );
+                Binding binding = new Binding( name.toUpName(), entry, false );
                 nclistener.objectRemoved( new NamingEvent( rec.getEventContext(), NamingEvent.OBJECT_REMOVED,
null,
                     binding, entry ) );
             }
@@ -283,8 +284,8 @@
             if ( listener instanceof ObjectChangeListener )
             {
                 ObjectChangeListener oclistener = ( ObjectChangeListener ) listener;
-                Binding before = new Binding( name.toString(), oriEntry, false );
-                Binding after = new Binding( name.toString(), entry, false );
+                Binding before = new Binding( name.toUpName(), oriEntry, false );
+                Binding after = new Binding( name.toUpName(), entry, false );
                 oclistener.objectChanged( new NamingEvent( rec.getEventContext(), NamingEvent.OBJECT_CHANGED,
after,
                     before, mods ) );
             }
@@ -338,8 +339,8 @@
             if ( listener instanceof NamespaceChangeListener )
             {
                 NamespaceChangeListener nclistener = ( NamespaceChangeListener ) listener;
-                Binding oldBinding = new Binding( oldName.toString(), entry, false );
-                Binding newBinding = new Binding( newName.toString(), entry, false );
+                Binding oldBinding = new Binding( oldName.toUpName(), entry, false );
+                Binding newBinding = new Binding( newName.toUpName(), entry, false );
                 nclistener.objectRenamed( new NamingEvent( rec.getEventContext(), NamingEvent.OBJECT_RENAMED,
                     newBinding, oldBinding, entry ) );
             }
@@ -353,6 +354,7 @@
         LdapDN newName = ( LdapDN ) name.clone();
         newName.remove( newName.size() - 1 );
         newName.add( newRn );
+        newName.normalize();
         notifyOnNameChange( name, newName );
     }
 

Modified: directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java?rev=413929&r1=413928&r2=413929&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
(original)
+++ directory/branches/apacheds/optimization/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java
Tue Jun 13 09:16:24 2006
@@ -148,8 +148,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
     }
 
 
@@ -181,8 +180,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
     }
 
 
@@ -214,8 +212,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
     }
 
 
@@ -247,8 +244,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
     }
 
 
@@ -283,8 +279,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
     }
 
@@ -320,10 +315,9 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODDN );
-        assertEquals( ( RDN + ",ou=system" ).toLowerCase(), listener.result.control.getPreviousDn().getNormName()
);
+        assertEquals( ( RDN + ",ou=system" ), listener.result.control.getPreviousDn().getUpName()
);
     }
 
 
@@ -358,8 +352,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.DELETE );
     }
 
@@ -395,8 +388,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
     }
 
@@ -434,8 +426,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
         listener.result = null;
         t = new Thread( listener );
@@ -469,8 +460,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
     }
 
@@ -511,8 +501,7 @@
     //        
     //        assertEquals( 6, listener.count );
     //        assertNotNull( listener.result );
-    //        // darn it getting normalized name back
-    //        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+    //        assertEquals( "cn=Jack Black", listener.result.getName() );
     //        assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
     //    }
 
@@ -578,8 +567,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( "cn=Jack Black".toLowerCase(), listener.result.getName().toLowerCase()
);
+        assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
         listener.result = null;
         t = new Thread( listener );
@@ -614,8 +602,7 @@
         }
 
         assertNotNull( listener.result );
-        // darn it getting normalized name back
-        assertEquals( RDN.toLowerCase(), listener.result.getName().toLowerCase() );
+        assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
     }
 



Mime
View raw message