lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/document TestDocument.java
Date Mon, 30 Aug 2004 21:03:40 GMT
dnaber      2004/08/30 14:03:40

  Modified:    src/test/org/apache/lucene/document TestDocument.java
  Log:
  add test for runtime exceptions
  
  Revision  Changes    Path
  1.6       +20 -1     jakarta-lucene/src/test/org/apache/lucene/document/TestDocument.java
  
  Index: TestDocument.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/document/TestDocument.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDocument.java	30 Aug 2004 20:56:04 -0000	1.5
  +++ TestDocument.java	30 Aug 2004 21:03:40 -0000	1.6
  @@ -70,6 +70,25 @@
       assertEquals(0, doc.fields.size());
     }
   
  +  public void testConstructorExceptions()
  +  {
  +    new Field("name", "value", Field.Store.YES, Field.Index.NO);  // okay
  +    new Field("name", "value", Field.Store.NO, Field.Index.UN_TOKENIZED);  // okay
  +    try {
  +      new Field("name", "value", Field.Store.NO, Field.Index.NO);
  +      fail();
  +    } catch(IllegalArgumentException e) {
  +      // expected exception
  +    }
  +    new Field("name", "value", Field.Store.YES, Field.Index.NO, Field.TermVector.NO); //
okay
  +    try {
  +      new Field("name", "value", Field.Store.YES, Field.Index.NO, Field.TermVector.YES);
  +      fail();
  +    } catch(IllegalArgumentException e) {
  +      // expected exception
  +    }
  +  }
  +  
       /**
        * Tests {@link Document#getValues(String)} method for a brand new Document
        * that has not been indexed yet.
  
  
  

---------------------------------------------------------------------
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