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 TestTermVectorsReader.java
Date Sun, 28 Nov 2004 13:40:47 GMT
bmesser     2004/11/28 05:40:47

  Modified:    src/test/org/apache/lucene/index TestTermVectorsReader.java
  Log:
  catch IOException rather than all Exceptions in testBadParams(). Add another "bad document
number" test without a field value. Remove unnecessary cast.
  
  Revision  Changes    Path
  1.3       +13 -4     jakarta-lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
  
  Index: TestTermVectorsReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestTermVectorsReader.java	5 Oct 2004 17:30:47 -0000	1.2
  +++ TestTermVectorsReader.java	28 Nov 2004 13:40:47 -0000	1.3
  @@ -128,7 +128,7 @@
           }
         }
         
  -      TermFreqVector freqVector = (TermFreqVector)reader.get(0, testFields[1]); //no pos,
no offset
  +      TermFreqVector freqVector = reader.get(0, testFields[1]); //no pos, no offset
         assertTrue(freqVector != null);      
         assertTrue(freqVector instanceof TermPositionVector == false);
         terms = freqVector.getTerms();
  @@ -202,9 +202,18 @@
         TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
         assertTrue(reader != null);
         //Bad document number, good field number
  -      TermFreqVector vector = reader.get(50, testFields[0]);
  +      reader.get(50, testFields[0]);
         assertTrue(false);      
  -    } catch (Exception e) {
  +    } catch (IOException e) {
  +      assertTrue(true);
  +    }
  +    try {
  +      TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
  +      assertTrue(reader != null);
  +      //Bad document number, no field
  +      reader.get(50);
  +      assertTrue(false);      
  +    } catch (IOException e) {
         assertTrue(true);
       }
       try {
  @@ -213,7 +222,7 @@
         //good document number, bad field number
         TermFreqVector vector = reader.get(0, "f50");
         assertTrue(vector == null);      
  -    } catch (Exception e) {
  +    } catch (IOException e) {
         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