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

Michael McCandless commented on LUCENE-1617:
--------------------------------------------

Hmm -- how does one test the non-sub-package tests?  Eg 
org.apache.lucene.TestDemo?

I tried "ant test -Dtestpackage=" but that seems to incorrectly run legacy 
(non-junit) tests, eg:

{code}
[junit] Testsuite: org.apache.lucene.AnalysisTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.166 sec
[junit] 
[junit] Testcase: initializationError0(org.apache.lucene.AnalysisTest): Caused 
an ERROR
[junit] Test class should have public zero-argument constructor
[junit] java.lang.Exception: Test class should have public zero-argument 
constructor
[junit]         at 
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[junit]         at 
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[junit] Caused by: java.lang.NoSuchMethodException: 
org.apache.lucene.AnalysisTest.<init>()
[junit]         at java.lang.Class.getConstructor0(Class.java:2706)
[junit]         at java.lang.Class.getConstructor(Class.java:1657)
{code}

> 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
>
>
> 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