lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject svn commit: r784482 - /lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
Date Sat, 13 Jun 2009 22:05:14 GMT
Author: kalle
Date: Sat Jun 13 22:05:14 2009
New Revision: 784482

URL: http://svn.apache.org/viewvc?rev=784482&view=rev
Log:
LUCENE-1578: Support for loading unoptimized readers to the constructor of InstantiatedIndex.
(Karl Wettin)

Modified:
    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java

Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java?rev=784482&r1=784481&r2=784482&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
Sat Jun 13 22:05:14 2009
@@ -1,8 +1,24 @@
 package org.apache.lucene.store.instantiated;
 
+/*
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
 import junit.framework.TestCase;
 
 import java.io.IOException;
+import java.util.Map;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriter;
@@ -13,7 +29,6 @@
 import org.apache.lucene.document.Field;
 
 /**
- * @author kalle
  * @since 2009-mar-30 13:15:49
  */
 public class TestUnoptimizedReaderOnConstructor extends TestCase {
@@ -23,25 +38,29 @@
     IndexWriter iw = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
     addDocument(iw, "Hello, world!");
     addDocument(iw, "All work and no play makes jack a dull boy");
-    iw.commit("a");
     iw.close();
 
     iw = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
     addDocument(iw, "Hello, tellus!");
     addDocument(iw, "All work and no play makes danny a dull boy");
-    iw.commit("b");
     iw.close();
 
     iw = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
     addDocument(iw, "Hello, earth!");
     addDocument(iw, "All work and no play makes wendy a dull girl");
-    iw.commit("c");
     iw.close();
 
     IndexReader unoptimizedReader = IndexReader.open(dir);
     unoptimizedReader.deleteDocument(2);
 
-    InstantiatedIndex ii = new InstantiatedIndex(unoptimizedReader);
+    InstantiatedIndex ii;
+    try {
+     ii = new InstantiatedIndex(unoptimizedReader);
+    } catch (Exception e) {
+      fail("No exceptions when loading an unoptimized reader!");
+    }
+
+    // todo some assertations.
 
   }
 



Mime
View raw message