public void testIndexReaderReopen() throws Exception{
Directory idxDir = new RAMDirectory();
Document[] docs = buildData();
IndexWriter writer = new IndexWriter(idxDir,new StandardAnalyzer(Version.LUCENE_29),MaxFieldLength.UNLIMITED);
writer.addDocument(docs[0]);
writer.optimize();
writer.commit();
IndexReader idxReader = IndexReader.open(idxDir,true);
BoboIndexReader boboReader = BoboIndexReader.getInstance(idxReader,_fconf);
for (int i=1;i<docs.length;++i){
Document doc = docs[i];
int numDocs = boboReader.numDocs();
BoboIndexReader reader = (BoboIndexReader)boboReader.reopen(true);
assertSame(boboReader,reader);
Directory tmpDir = new RAMDirectory();
IndexWriter subWriter = new IndexWriter(tmpDir,new StandardAnalyzer(Version.LUCENE_29),MaxFieldLength.UNLIMITED);
subWriter.addDocument(doc);
subWriter.optimize();
subWriter.close();
writer.addIndexesNoOptimize(new Directory[]{tmpDir});
writer.commit();