lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] Commented: (LUCENE-2642) merge LuceneTestCase and LuceneTestCaseJ4
Date Mon, 13 Sep 2010 12:12:33 GMT


Robert Muir commented on LUCENE-2642:

bq. I am just afraid of extending form the old JUnit Testcase.

we already extend this! Have you looked at LuceneTestCase lately?

bq. So extend Assert and the add missing static methods for compatibility.

Please, i would like to keep the epsilon stuff out of this issue. All tests pass the way it
is now, there is no

We can fix epsilons in a followup issue, and then use no junit3 code at all... as I said its
a great improvement, but not necessary to mix in with this change.

By doing both at once, if somethign goes wrong, it will be more difficult to debug. Lets keep
the scope under control.

> merge LuceneTestCase and LuceneTestCaseJ4
> -----------------------------------------
>                 Key: LUCENE-2642
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Test
>          Components: Tests
>            Reporter: Robert Muir
>             Fix For: 3.1, 4.0
>         Attachments: LUCENE-2642.patch
> We added Junit4 support, but as a separate test class.
> So unfortunately, we have two separate base classes to maintain: LuceneTestCase and LuceneTestCaseJ4.
> This creates a mess and is difficult to manage.
> Instead, I propose a single base test class that works both junit3 and junit4 style.
> I modified our LuceneTestCaseJ4 in the following way:
> * the methods to run are not limited to the ones annotated with @Test, but also any void
no-arg methods that start with "test", like junit3. this means you dont have to sprinkle @Test
> * of course, @Ignore works as expected everywhere.
> * LuceneTestCaseJ4 extends TestCase so you dont have to import static Assert.* to get
all the asserts.
> for most tests, no changes are required. but a few very minor things had to be changed:
> * setUp() and tearDown() must be public, not protected.
> * useless ctors must be removed, such as TestFoo(String name) { super(name); }
> * LocalizedTestCase is gone, instead of
> {code}
> public class TestQueryParser extends LocalizedTestCase {
> {code}
> it is now
> {code}
> @RunWith(LuceneTestCase.LocalizedTestCaseRunner.class)
> public class TestQueryParser extends LuceneTestCase {
> {code}
> * Same with MultiCodecTestCase: (LuceneTestCase.MultiCodecTestCaseRunner.class}
> I only did the core tests in the patch as a start, and i just made an empty LuceneTestCase
extends LuceneTestCaseJ4.
> I'd like to do contrib and solr and rename this LuceneTestCaseJ4 to only a single class:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message