directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r676099 - in /directory/apacheds/branches/bigbang: core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Date Fri, 11 Jul 2008 23:19:44 GMT
Author: elecharny
Date: Fri Jul 11 16:19:43 2008
New Revision: 676099

URL: http://svn.apache.org/viewvc?rev=676099&view=rev
Log:
Added some sleep(1000) in order to get the test happy : as the events are not sent synchronously,
we need those sleeps to have the events being processed before we can check they have been
processed.

Modified:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java?rev=676099&r1=676098&r2=676099&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
Fri Jul 11 16:19:43 2008
@@ -74,6 +74,9 @@
         testEntry.put( objectClass );
         ctx.createSubcontext( "ou=testentry", testEntry );
 
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         EventRecord rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );
@@ -82,6 +85,9 @@
         ctx.removeNamingListener( listener );
         ctx.destroySubcontext( "ou=testentry" );
 
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );
@@ -89,6 +95,10 @@
 
         // read the entry once again just to make sure
         ctx.createSubcontext( "ou=testentry", testEntry );
+        
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );
@@ -114,6 +124,9 @@
         testEntry.put( objectClass );
         ctx.createSubcontext( "ou=testentry", testEntry );
 
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         EventRecord rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );
@@ -123,12 +136,19 @@
         ctx = ( EventDirContext ) getSystemContext( service ).lookup( "" );
         ctx.destroySubcontext( "ou=testentry" );
 
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );
 
         // readd the entry once again just to make sure
         ctx.createSubcontext( "ou=testentry", testEntry );
+        
+        //  Wait 1 second, as the process is asynchronous
+        Thread.sleep( 1000 );
+
         assertEquals( 1, listener.getEventRecords().size() );
         rec = ( EventRecord ) listener.getEventRecords().get( 0 );
         assertEquals( "objectAdded", rec.method );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=676099&r1=676098&r2=676099&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Fri Jul 11 16:19:43 2008
@@ -290,6 +290,7 @@
         for ( RegistrationEntry registration : registrations )
         {
             NotificationCriteria criteria = registration.getCriteria();
+            
             if ( evaluator.evaluate( criteria.getFilter(), criteria.getBase().toNormName(),
entry ) )
             {
                 selecting.add( registration );



Mime
View raw message