improve test

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1595424 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-05-17 05:21:43 +00:00
parent a891b969d9
commit d73ff28707
1 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
import org.apache.lucene.document.BinaryDocValuesField;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@ -1502,6 +1503,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
String value = null;
doc.add(new StoredField("foo", value));
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (IllegalArgumentException expected) {}
iw.shutdown();
// make sure we see our good doc
@ -1525,6 +1527,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
// set to null value
theField.setStringValue(null);
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (IllegalArgumentException expected) {}
iw.shutdown();
// make sure we see our good doc
@ -1549,6 +1552,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
Field theField = new StoredField("foo", v);
doc.add(theField);
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (NullPointerException expected) {}
iw.shutdown();
// make sure we see our good doc
@ -1573,6 +1577,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
byte v[] = null;
theField.setBytesValue(v);
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (NullPointerException expected) {}
iw.shutdown();
// make sure we see our good doc
@ -1597,6 +1602,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
Field theField = new StoredField("foo", v);
doc.add(theField);
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (IllegalArgumentException expected) {}
iw.shutdown();
// make sure we see our good doc
@ -1621,6 +1627,7 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
BytesRef v = null;
theField.setBytesValue(v);
iw.addDocument(doc);
fail("didn't get expected exception");
} catch (IllegalArgumentException expected) {}
iw.shutdown();
// make sure we see our good doc