lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer" <>
Subject Re: EMAIL ADDRESS: Tokenize (i.e. an EmailAnalyzer)
Date Fri, 04 Aug 2006 17:08:51 GMT
Hey Michael,

you might fall in love with the green bar after using it for a while.
If you use eclipse or some other ide including junit it so easy and powerful.

You might find some help here as well:

As hossman said very important is to test limit values of  your "unit".
You should also let your test fail at the right moment and catch the
exception to test it for illegal values or state.
Something like that does a good job if you expect an exc.

fail("illegal state");
}catch(theexc e){}

Have a look at the class junit.framework.Assert, the static methods
are very helpful.

to keep the code clean, keep the bar green :)


On 8/4/06, Chris Hostetter <> wrote:
> : Oh boy, how embarrassing for me.  I have never used any unit tests...I
> : know I know...don't freak out people :)  I pretty much just started
> : really coding in Java.  So, is there anyone out there who has time to
> : help me add these to the code?  I would appreciate it and, on the plus
> : side, the code will be better tested for the community.
> Writing unit tests is a lot easier then it sounds .. especially if you are
> writting them as they are ment to be: test of small "units" of code.
> take al ook at some of the existing Filter tests, they should give you a
> good idea of how to write a test...
> ..the ideal thing is to not only test the expected "good" cases, but
> also any cases where you expect an error to be generated -- not exactly
> common in a TokenFilter, but it would be a good idea for example to test
> what your Filter does when given plain text (ie: not an email address)
> -Hoss
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message