> I get an error An error? Or no executed tests? It should be no-matching tests, really.
> Is it possible that the runner will add that '*' for me so that I just > specify the test method name? In short no, it's not possible to do so automatically. There is no such thing as a "method name" in JUnit, there's only a string description and this can be anything -- doesn't have to follow any rules or conventions. The runner would have to guess what you had in mind. Dawid On Tue, Oct 15, 2013 at 1:38 PM, Shai Erera <ser...@gmail.com> wrote: >> Then when you want to rerun your test and limit to that >> particular method you need to glob somehow because these descriptions >> no longer correspond to raw method names > > > I think it is related but not sure, yet it bugs me. When I want to run same > method with iterations I need to specify "-Dtests.method=testFoo* > -Dtests.iters=10". If I just specify testFoo, I get an error. Is it possible > that the runner will add that '*' for me so that I just specify the test > method name? Or is this also related to JUnit limitation? > > Shai > > > On Tue, Oct 15, 2013 at 2:18 PM, Michael McCandless > <luc...@mikemccandless.com> wrote: >> >> On Tue, Oct 15, 2013 at 6:56 AM, Dawid Weiss >> <dawid.we...@cs.put.poznan.pl> wrote: >> >> Hmm, you couldn't just enter the unqualified class name, and then it'd >> >> match any package containing that class name? LIke "**/TestFooBar" >> >> patternset pattern I think? >> > >> > This isn't different to your "duplicated test match" scenario. Same >> > class could be present in multiple packages -- what then? :) >> >> Just run both tests in that case, I think? User can fully qualify if >> they really want to run a specific one? >> >> That's a much more benign error than saying BUILD SUCCESSFUL when no >> test actually ran. >> >> >> Hmm, so globs are a convenient way to work around a JUnit limitation? >> > >> > I'm not talking about globs, I'm talking about the fact that every >> > test needs a unique string description so if you want to re-run the >> > same method multiple times in JUnit you need to differentiate them >> > somehow. Then when you want to rerun your test and limit to that >> > particular method you need to glob somehow because these descriptions >> > no longer correspond to raw method names... eh, it's a longer >> > discussion. >> >> OK, hairy :) >> >> >> I also did not remember -Dtests.method=XXX was different.... I believe >> >> you've explained this many times already ;) >> >> >> >> I'll [hopefully remember to] use -Dtests.method from now on! >> > >> > See the top of 'ant test-help': >> >> Thanks. >> >> > You're right -- testmethod is a prefix match and testcase is a suffix/ >> > class match. The runner only "understands" tests.class and >> > tests.method -- if you're running from Eclipse or Idea, for example, >> > only these will be picked up. >> >> OK. >> >> Mike McCandless >> >> http://blog.mikemccandless.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org >> For additional commands, e-mail: dev-h...@lucene.apache.org >> > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org