Author: chetanm
Date: Mon Jul 10 11:39:00 2017
New Revision: 1801449

URL: http://svn.apache.org/viewvc?rev=1801449&view=rev
Log:
OAK-6432 - Make dynamic reference greedy and static to simplify 
LuceneIndexProviderService

Move the registration of NodeAggregator outside of loop as now 
LuceneIndexProviderService has a static dependency and doing this would
cause the LuceneIndexProviderService to reactivate which can cause the second
assertion to fail everytime.

Now we register it only once

Modified:
    
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/LuceneSupportTest.groovy

Modified: 
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/LuceneSupportTest.groovy
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/LuceneSupportTest.groovy?rev=1801449&r1=1801448&r2=1801449&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/LuceneSupportTest.groovy
 (original)
+++ 
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/LuceneSupportTest.groovy
 Mon Jul 10 11:39:00 2017
@@ -70,15 +70,13 @@ class LuceneSupportTest extends Abstract
                 new ByteArrayInputStream("the quick brown fox jumps over the 
lazy dog.".getBytes('utf-8')))
         session.save()
 
+        SimpleNodeAggregator agg = new SimpleNodeAggregator().newRuleWithName(
+                NT_FILE, newArrayList(JCR_CONTENT, JCR_CONTENT + "/*"));
+        getRegistry ( ).registerService ( 
QueryIndex.NodeAggregator.class.name, agg, null )
+
         //The lucene index is set to synched mode
         retry(30, 200) {
             String query = "SELECT * FROM [nt:base] as f WHERE CONTAINS (f.*, 
'dog')"
-            assert [ '/myFile/jcr:content' ] as HashSet == execute ( query )
-
-            SimpleNodeAggregator agg = new 
SimpleNodeAggregator().newRuleWithName(
-                    NT_FILE, newArrayList(JCR_CONTENT, JCR_CONTENT + "/*"));
-            getRegistry ( ).registerService ( 
QueryIndex.NodeAggregator.class.name, agg, null )
-
             assert [ "/myFile", '/myFile/jcr:content' ] as HashSet == execute 
( query )
             return true
         }


Reply via email to