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
@@ -70,15 +70,13 @@ class LuceneSupportTest extends AbstractRepositoryFactoryTest {
new ByteArrayInputStream("the quick brown fox jumps over the lazy dog.".getBytes('utf-8')))
session.save()
- //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 )
+ //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", '/myFile/jcr:content' ] as HashSet == execute ( query )
return true
}
