From java-user-return-22501-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Fri Aug 04 16:41:43 2006 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 50738 invoked from network); 4 Aug 2006 16:41:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Aug 2006 16:41:43 -0000 Received: (qmail 38393 invoked by uid 500); 4 Aug 2006 16:41:37 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 38369 invoked by uid 500); 4 Aug 2006 16:41:37 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 38358 invoked by uid 99); 4 Aug 2006 16:41:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 09:41:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 09:41:35 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 22CDF5B766; Fri, 4 Aug 2006 09:41:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 19AA07F403 for ; Fri, 4 Aug 2006 09:41:01 -0700 (PDT) Date: Fri, 4 Aug 2006 09:41:01 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: EMAIL ADDRESS: Tokenize (i.e. an EmailAnalyzer) In-Reply-To: <44D34A5F.5000107@mac.com> Message-ID: References: <20060731021247.11211.qmail@web50315.mail.yahoo.com> <44CE0543.6050302@mac.com> <44D34A5F.5000107@mac.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N : 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... http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java?revision=347991&view=markup http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestLengthFilter.java?view=markup http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/analysis/TestStopFilter.java?revision=382158&view=markup ..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: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org