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

Max Rydahl Andersen max.andersen at redhat.com
Fri Jan 23 10:31:43 EST 2015


On 23 Jan 2015, at 14:58, Paul Richardson wrote:

> On 23/01/15 11:42, Max Rydahl Andersen wrote:
>>>
>> One drawback of not having testsuites is though that we loose the 
>> ability to easily run a
>> group of tests from eclipse or maven.
>>
>> Anyone found a good way of doing that via junit ? (testng has groups 
>> but tycho surefire/junit
>> does not support that afaik)
>
> Yes. Designer has had a test-aggregate plugin for all its junit tests 
> for a while now. [1]
>
> Based on an idea from my last job, the TestDesignerTestGatherer[2] 
> class is a junit 3 style test
> suite.
>
> It essentially runs through all the bundles in the running platfrom, 
> searching for (in this case)
> AllTests classes then adds them to the suite. The suite is executed 
> via junit and the all the
> tests individually executed. This works in both Eclipse (using a 
> single junit launcher) and in
> maven (by making the plugin a test plugin and adding TestGatherer to 
> an AllTests suite class).

I'm not following what this class helps do that surefire not already 
does ?

How would this be used to group tests within the same test plugin into 
something I can run ?

for me it looks like this one just picks up *all* test classes which is 
already possible today with junit launch to just have it run all tests 
found in a package or project ?

/max

>
> This mechanism can be easily generalised to work with different test 
> names if preferred.
>
> PGR
>
> [1]
> https://github.com/Teiid-Designer/teiid-designer/tree/master/test-aggregate/org.teiid.designer.aggregate.test
> [2]
> https://github.com/Teiid-Designer/teiid-designer/blob/master/test-aggregate/org.teiid.designer.aggregate.test/src/org/teiid/designer/aggregate/test/TestDesignerTestGatherer.java
>
> - --
> Paul Richardson
>
> * p.g.richardson at redhat.com
> * pgrichardson at linux.com
> * mob: +44 (0)9780 869490


/max
http://about.me/maxandersen



More information about the jbosstools-dev mailing list