mirror of https://github.com/apache/lucene.git
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:
parent
a891b969d9
commit
d73ff28707
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue