[jbosstools-dev] Should we use @Ignore in non-runnable JUnit test classes, instead of <include> in pom? (was: JUnit Tests)

Nick Boldt nboldt at redhat.com
Thu Jan 22 14:51:46 EST 2015


No, because then AbstractTest* and TemplateTest* classes would run, and 
they shouldn't be.

You can set your own <include> entries in your root pom. Then all your 
projects' tests will inherit those new rules.

--

We may also have some older JUnit 3 tests (from the JDK 1.4 era?) that 
might still be set to run with older JRE environments, where 
@annotations are not supported.

If I'm wrong on that, and we no longer support running tests w/ old 
runtimes, then yes, we could consider adding @Ignores to all the tests 
which shouldn't be run, instead of using the "All" and "Suite" naming 
conventions.

--

I've cc:'d the jbosstools-dev list because a wider audience might be 
able to comment better on if it's time to move to using @ignore instead 
of using restrictive patterns when running JUnits w/ Surefire in 
Tycho/Maven builds.

N

On 01/22/2015 02:08 PM, Daniel Florian wrote:
> Guys,
>
> We currently have to add each JUnit test class to a test suite file called AllTests.java. If a test does not get added to this test suite it does not get run.
>
> I think the pom has this:
>
> <includes>
>                <include>**/AllTests.class</include>
>                <include>**/*AllTests*.class</include>
>                <include>**/*AllBotTests*.class</include>
>                <include>**/*TestSuite*.class</include>
> </includes>
>
> Could we add:
>
>                <include>**/Test*.class</include>
>                <include>**/*Test.class</include>
>
> So that we wouldn't need an AllTests.java. Other projects can keep using the test suite approach.
>
> With JUnit's @Ignore it is easy to stop a test from being run.
>
> wdyt?
>
> Thanks,
>
> Dan
>

-- 
Nick Boldt :: JBoss by Red Hat
Productization Lead :: JBoss Tools & Dev Studio
http://nick.divbyzero.com


More information about the jbosstools-dev mailing list