lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: tests cases, Ruby, commitership
Date Sat, 19 Jul 2003 11:20:45 GMT
Hello Erik,

No, I don't think there are any such low-level tests.  It would be good
to have them.  If you write a solid suite of such tests, perhaps they
could be molded into a utility for checking index integrity.

As for your access to Lucene CVS - hello no!  Just kidding, of course,
I think that would be appropriate.  We'll do one of those [VOTE] things


--- Erik Hatcher <> wrote:
> I am embarking on an ambitious project, the implementation of a Ruby 
> API for the Lucene index file format (name suggestions welcome!).  In
> digging under the covers deeper than ever before, I'm learning lots
> of 
> what makes Lucene tick.  In order to really learn it, I'm writing
> some 
> unit tests to assert my understanding.  Here's an example:
> public class InputStreamTest extends TestCase {
>      public void testReadVInt() throws IOException {
>          InputStream is = new MockInputStream(new byte[] { (byte)
> 0x80, 
> 0x01,
>                                                            (byte)
> 0xFF, 
> 0x7F,
>                                                            (byte)
> 0x80, 
> (byte) 0x80, 0x01,
>                                                            (byte)
> 0x81, 
> (byte) 0x80, 0x01});
>          assertEquals(128,is.readVInt());
>          assertEquals(16383,is.readVInt());
>          assertEquals(16384,is.readVInt());
>          assertEquals(16385,is.readVInt());
>      }
> }
> The MockInputStream is a Lucene InputStream subclass that simply
> feeds 
> out the bytes, similar to the RAMDirectory$RAMInputStream.  The above
> asserts come directly from the documentation on the file format 
> description of VInt  I don't believe there are existing unit tests
> that 
> are asserting features at this low of a level, are there?
> I would like to make these unit tests part of Lucene's codebase.
> Is it bad form to propose myself as a committer to CVS on Lucene?  
> I'm 
> already a jakarta-lucene-sandbox and Ant committer (and also a 
> committer on the SourceForge XDoclet project), as well as a newly 
> elected ASF Member - just so you know I'll be responsible with the 
> codebase :)  It would be more fun to commit my test cases (and only 
> test cases at this point, no functionality changes at all - Lucene 
> works perfectly well for me as is) myself than to submit them as 
> patches.  Also, you certainly could expect documentation additions
> over 
> time as well.
> Thanks,
> 	Erik
> p.s. If anyone knows of an existing or in-the-works Ruby 
> implementation, please let me know so I don't reinvent the wheel.  Or
> if you'd like to assist, it'll certainly be open-source.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message