public void testBadSegment() throws IOException {
  Directory dir=newDirectory();
  IndexWriter iw=new IndexWriter(dir,newIndexWriterConfig(new MockAnalyzer(random())));
  Document document=new Document();
  FieldType customType=new FieldType(TextField.TYPE_NOT_STORED);
  customType.setStoreTermVectors(true);
  document.add(newField("tvtest","",customType));
  iw.addDocument(document);
  iw.close();
  dir.close();
}

public void testBadSegment ( ) throws IOException { Directory dir = newDirectory ( ) ; IndexWriter iw = new IndexWriter ( dir , newIndexWriterConfig ( new MockAnalyzer ( random ( ) ) ) ) ; Document document = new Document ( ) ; FieldType customType = new FieldType ( TextField . TYPE_NOT_STORED ) ; customType . setStoreTermVectors ( true ) ; document . add ( newField ( "tvtest" , "" , customType ) ) ; iw . addDocument ( document ) ; iw . close ( ) ; dir . close ( ) ; }
test that no nullpointerexception will be raised , when adding one document with a single , empty field and term vectors enabled .
