lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r822136 - /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
Date Tue, 06 Oct 2009 05:56:51 GMT
Author: buschmi
Date: Tue Oct  6 05:56:51 2009
New Revision: 822136

URL: http://svn.apache.org/viewvc?rev=822136&view=rev
Log:
LUCENE-486: Remove test->demo dependencies.

Modified:
    lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java?rev=822136&r1=822135&r2=822136&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestDoc.java
Tue Oct  6 05:56:51 2009
@@ -16,19 +16,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.lucene.util.LuceneTestCase;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
-
 import org.apache.lucene.analysis.SimpleAnalyzer;
-import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.store.Directory;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.demo.FileDocument;
-
-import java.io.*;
-import java.util.*;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.util.LuceneTestCase;
 
 
 /** JUnit adaptation of an older test case DocTest.
@@ -163,7 +169,8 @@
    throws Exception
    {
       File file = new File(workDir, fileName);
-      Document doc = FileDocument.Document(file);
+      Document doc = new Document();
+      doc.add(new Field("contents", new FileReader(file)));
       writer.addDocument(doc);
       writer.flush();
       return writer.newestSegment();



Mime
View raw message