You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by go...@apache.org on 2003/11/20 20:03:22 UTC

cvs commit: jakarta-lucene/src/test/org/apache/lucene/index TestCompoundFile.java

goller      2003/11/20 11:03:22

  Modified:    src/test/org/apache/lucene/index TestCompoundFile.java
  Log:
  seek checks removed; such ckecks are not implemented
  by the other subclasses of InputStream either. Unit test
  adapted accordingly.
  
  Revision  Changes    Path
  1.4       +4 -20     jakarta-lucene/src/test/org/apache/lucene/index/TestCompoundFile.java
  
  Index: TestCompoundFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/index/TestCompoundFile.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestCompoundFile.java	23 Oct 2003 02:02:06 -0000	1.3
  +++ TestCompoundFile.java	20 Nov 2003 19:03:22 -0000	1.4
  @@ -64,6 +64,7 @@
   import org.apache.lucene.store.Directory;
   import org.apache.lucene.store.InputStream;
   import org.apache.lucene.store.FSDirectory;
  +import org.apache.lucene.store.RAMDirectory;
   import org.apache.lucene.store._TestHelper;
   
   
  @@ -163,25 +164,8 @@
                                      long seekTo)
       throws IOException
       {
  -        if (seekTo < 0) {
  -            try {
  -                actual.seek(seekTo);
  -                fail(msg + ", " + seekTo + ", negative seek");
  -            } catch (IOException e) {
  -                /* success */
  -                //System.out.println("SUCCESS: Negative seek: " + e);
  -            }
  -
  -        } else if (seekTo > 0 && seekTo >= expected.length()) {
  -            try {
  -                actual.seek(seekTo);
  -                fail(msg + ", " + seekTo + ", seek past EOF");
  -            } catch (IOException e) {
  -                /* success */
  -                //System.out.println("SUCCESS: Seek past EOF: " + e);
  -            }
  -
  -        } else {
  +        if(seekTo >= 0 && seekTo < expected.length())
  +        {
               expected.seek(seekTo);
               actual.seek(seekTo);
               assertSameStreams(msg + ", seek(mid)", expected, actual);
  
  
  

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