jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1362176 - in /jackrabbit/trunk: jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-parent/
Date Mon, 16 Jul 2012 18:29:10 GMT
Author: alexparvulescu
Date: Mon Jul 16 18:29:10 2012
New Revision: 1362176

URL: http://svn.apache.org/viewvc?rev=1362176&view=rev
Log:
JCR-3242 Update to Lucene 3.6

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
    jackrabbit/trunk/jackrabbit-parent/pom.xml

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java?rev=1362176&r1=1362175&r2=1362176&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/AbstractQueryTest.java
Mon Jul 16 18:29:10 2012
@@ -214,7 +214,7 @@ public class AbstractQueryTest extends A
         // check if all expected are in result
         for (Iterator<String> it = expectedPaths.iterator(); it.hasNext();) {
             String path = it.next();
-            assertTrue(path + " is not part of the result set "+ expectedPaths, resultPaths.contains(path));
+            assertTrue(path + " is not part of the result set "+ resultPaths, resultPaths.contains(path));
         }
         // check result does not contain more than expected
         for (Iterator<String> it = resultPaths.iterator(); it.hasNext();) {
@@ -251,6 +251,7 @@ public class AbstractQueryTest extends A
      */
     protected QueryResult executeQuery(String statement)
             throws RepositoryException {
+        getSearchIndex().flush();
         if (statement.trim().toLowerCase().startsWith("select")) {
             return qm.createQuery(statement, Query.SQL).execute();
         } else {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java?rev=1362176&r1=1362175&r2=1362176&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
Mon Jul 16 18:29:10 2012
@@ -22,6 +22,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermEnum;
 import org.apache.lucene.store.Directory;
@@ -61,21 +62,28 @@ public class ChainedTermEnumTest extends
     protected TermEnum createTermEnum(String prefix, int numTerms)
             throws IOException {
         Directory dir = new RAMDirectory();
-        IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer(Version.LUCENE_24),
-                true, IndexWriter.MaxFieldLength.UNLIMITED);
-        for (int i = 0; i < numTerms; i++) {
-            Document doc = new Document();
-            doc.add(new Field("field", true, prefix + i, Field.Store.NO,
-                    Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
-            writer.addDocument(doc);
+        IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
+                Version.LUCENE_36, new StandardAnalyzer(Version.LUCENE_36)));
+        try {
+            for (int i = 0; i < numTerms; i++) {
+                Document doc = new Document();
+                doc.add(new Field("field", true, prefix + i, Field.Store.NO,
+                        Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
+                writer.addDocument(doc);
+            }
+        } finally {
+            writer.close();
         }
-        writer.close();
-        IndexReader reader = IndexReader.open(dir, false);
-        TermEnum terms = reader.terms();
-        if (terms.term() == null) {
-            // position at first term
-            terms.next();
+        IndexReader reader = IndexReader.open(dir);
+        try {
+            TermEnum terms = reader.terms();
+            if (terms.term() == null) {
+                // position at first term
+                terms.next();
+            }
+            return terms;
+        } finally {
+            reader.close();
         }
-        return terms;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java?rev=1362176&r1=1362175&r2=1362176&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/IndexMigrationTest.java
Mon Jul 16 18:29:10 2012
@@ -50,7 +50,7 @@ public class IndexMigrationTest extends 
         DirectoryManager dirMgr = new RAMDirectoryManager();
 
         PersistentIndex idx = new PersistentIndex("index",
-                new StandardAnalyzer(Version.LUCENE_24), Similarity.getDefault(),
+                new StandardAnalyzer(Version.LUCENE_36), Similarity.getDefault(),
                 new DocNumberCache(100),
                 new IndexingQueue(new IndexingQueueStore(new RAMDirectory())),
                 dirMgr, 0);

Modified: jackrabbit/trunk/jackrabbit-parent/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-parent/pom.xml?rev=1362176&r1=1362175&r2=1362176&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-parent/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-parent/pom.xml Mon Jul 16 18:29:10 2012
@@ -362,7 +362,7 @@
       <dependency>
         <groupId>org.apache.lucene</groupId>
         <artifactId>lucene-core</artifactId>
-        <version>3.0.3</version>
+        <version>3.6.0</version>
       </dependency>
       <dependency>
         <groupId>org.apache.tika</groupId>



Mime
View raw message