[email protected]
[Top] [All Lists]

Re: svn commit: r331111 - /lucene/java/trunk/src/test/org/apache/lucene/

Subject: Re: svn commit: r331111 - /lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
From: Paul Elschot
Date: Mon, 7 Nov 2005 09:14:59 +0100
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
> >

Paul Elschot

To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

<Prev in Thread] Current Thread [Next in Thread>