lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmes...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/index TestTermVectorsWriter.java
Date Sun, 21 Nov 2004 22:33:54 GMT
bmesser     2004/11/21 14:33:54

  Modified:    src/test/org/apache/lucene/index TestTermVectorsWriter.java
  Log:
  add a test for bug 31976
  
  Revision  Changes    Path
  1.5       +21 -0     jakarta-lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
  
  Index: TestTermVectorsWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/index/TestTermVectorsWriter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestTermVectorsWriter.java	5 Oct 2004 17:30:47 -0000	1.4
  +++ TestTermVectorsWriter.java	21 Nov 2004 22:33:54 -0000	1.5
  @@ -17,6 +17,10 @@
    */
   
   import junit.framework.TestCase;
  +
  +import org.apache.lucene.analysis.standard.StandardAnalyzer;
  +import org.apache.lucene.document.Document;
  +import org.apache.lucene.document.Field;
   import org.apache.lucene.store.RAMDirectory;
   
   import java.io.IOException;
  @@ -195,6 +199,23 @@
           checkTermVector(reader, 2, testFields[2]);
         }
       } catch (IOException e) {
  +      e.printStackTrace();
  +      assertTrue(false);
  +    }
  +  }
  +  
  +  public void testBadSegment() {
  +    try {
  +      dir = new RAMDirectory();
  +      IndexWriter ir = new IndexWriter(dir, new StandardAnalyzer(), true);
  +      
  +      Document document = new Document();
  +      document.add(new Field("tvtest", "", Field.Store.NO, Field.Index.TOKENIZED,
  +          Field.TermVector.YES));    // throws exception, works with Field.TermVector.NO
  +      ir.addDocument(document);
  +      
  +      ir.close();
  +    } catch (Exception e) {
         e.printStackTrace();
         assertTrue(false);
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message