lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: svn commit: r331111 - /lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
Date Mon, 07 Nov 2005 08:14:59 GMT
On Sunday 06 November 2005 18:00, Erik Hatcher wrote:
> I haven't looked at this code in detail, but it seems this resetting  
> could be done in tearDown() of the test cases rather than  
> complicating the tests with try/finally?
> 
> Just a JUnit FYI... tearDown is called after _each_ testXXX method,  
> so if the reset is needed in the middle of a testXXX then try/finally  
> makes sense (though separating into different test methods would be  
> better IMO).

Using tearDown() is indeed cleaner, but has the disadvantage that
changing the flag is done in two different places in the code,
so it could be overlooked by someone using the test code as 
a starting point for their own code.

The actual problem is that this flag in BooleanQuery is static, so an
even better solution would be to make it a normal attribute of each 
BooleanQuery object.

Since the accessing methods are not intended for normal use,
it would also be good to deprecate them now so they can
be easily deleted later.

...
> >
> > URL: http://svn.apache.org/viewcvs?rev=331111&view=rev
> > Log:
> > reset useScorer14 in finally in case of test failure
> >
> > Modified:
> >     lucene/java/trunk/src/test/org/apache/lucene/search/ 
> > TestBoolean2.java
> >

Regards,
Paul Elschot


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


Mime
View raw message