add test case

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294643 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-02-28 13:38:06 +00:00
parent f3cc65733b
commit 156106c9a8
1 changed files with 15 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
@ -38,8 +39,8 @@ import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.index.FieldInfo.IndexOptions;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.IndexSearcher;
@ -1787,4 +1788,17 @@ public class TestIndexWriter extends LuceneTestCase {
w.close();
dir.close();
}
public void testOnlyUpdateDocuments() throws Exception {
Directory dir = newDirectory();
IndexWriter w = new IndexWriter(dir,
new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)));
final List<Document> docs = new ArrayList<Document>();
docs.add(new Document());
w.updateDocuments(new Term("foo", "bar"),
docs);
w.close();
dir.close();
}
}