[ 
https://issues.apache.org/jira/browse/LUCENE-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703341#action_12703341
 ] 

Shai Erera commented on LUCENE-1617:
------------------------------------

Ok, so I've done some research, and I'm really puzzled. Everywhere I read, it 
is mentioned that <batchtest> uses <fileset> to include test cases, and that 
you should include them using a pattern like "**/Test*.java" ... which is what 
is done already if none of the special "test modes" is specified (a single 
test, a package or package-root).

However, for some reason if the definition looks like this, those non-TestCase 
classes are filtered out / skipped:
{code}
<fileset dir="src/test" includes="**/Test*.java,**/*Tets.java" />
{code}

But if the definition looks like this, they are executed, which results in a 
failure:
{code}
<fileset dir="src/test" includes="**/lucene/Test*.java,**/lucene/*Tets.java" />
{code}

As if the batchtest task behaves differently when the definition of "includes" 
contains a different pattern than the first one. I also tried to modify the 
"dir" attribute, to define "src/test/org/apache/lucene", but that doesn't seem 
to solve the problem.

So the only thing I can think of is to rename those classes to not start/end 
with "Test"? I'd hate to lose the ability to test an entire package, just 
because of that limitation. By running "ant test-core -Dtestpackage=lucene" I 
can discover all the non-test classes that start/end with Test.

What do you think?

> Add "testpackage" to common-build.xml
> -------------------------------------
>
>                 Key: LUCENE-1617
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1617
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Build
>            Reporter: Shai Erera
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1617.patch, LUCENE-1617.patch
>
>
> One can define "testcase" to execute just one test class, which is 
> convenient. However, I didn't notice any equivalent for testing a whole 
> package. I find it convenient to be able to test packages rather than test 
> cases because often it is not so clear which test class to run.
> Following patch allows one to "ant test -Dtestpackage=search" (for example) 
> and run all tests under the \*/search/\* packages in core, contrib and tags, 
> or do "ant test-core -Dtestpackage=search" and execute similarly just for 
> core, or do "ant test-core -Dtestpacakge=lucene/search/function" and run all 
> the tests under \*/lucene/search/function/\* (just in case there is another 
> o.a.l.something.search.function package out there which we want to exclude.

-- 
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: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to