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

Paul Richardson p.g.richardson at redhat.com
Fri Jan 23 11:52:16 EST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23/01/15 15:31, Max Rydahl Andersen wrote:
> 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 ?

Primarily the TestGatherer is meant for running tests while in Eclipse. It has the added benefit of
grouping all the tests together when building with maven.

So, this is what happens as it stands with the TestGatherer:
* In Eclipse I have lots of plugins open and I want to run all unit tests in my workspace.
* I create a junit-plugin launcher pointing to TestGatherer and execute it
* TestGatherer brings up an eclipse test IDE and hunts for all 'AllTests' in the platform and
executes them
* In effect, I have run all the AllTest classes in the development IDE using 1 junit test suite,
rather than having to run them individually.

The added benefit of this test-aggregating was that maven could also just run this single test plugin
rather than executing tests for all test plugins.

When I developed TestGatherer, Designer builds in Jenkins kept failing during the testing phase
due to a protocol error on the XVnc instance. If all test plugins brought up the XVnc instance
then the build was successful.

As an XVnc instance is required for each test plugin, I made all of our test plugins 'normal'
plugins and only the aggregate-plugin (housing TestGatherer) a test plugin. Consequently,
only 1 instance of XVnc is created when Jenkins  builds/tests and is responsible for executing
all the tests.

This configuration for maven may not be appropriate for other projects but it certainly has been
helpful in Designer development for running all tests in Eclipse.

PGR

- -- 
Paul Richardson

  * p.g.richardson at redhat.com
  * pgrichardson at linux.com
  * mob: +44 (0)9780 869490

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUwnw3AAoJEG7P2ul73V7cicUIALJatrcc0DK26Y2XvGP751E9
B7ED1YcGtBefy4/7kuvynd40g/+gP/WzxxrMV491qLhojXNHmXkhCf4iHG6fG71v
DmBbqKwfHwnFu2LnhBwryEgnY1Ud0TeNx0Yw8YayyCXAg7rrsBio7s0n7WcpYl1K
tYb74ty/ZKpG3WQZnfzAOzWZccBWW3Kng4umo2dNfiLEAwS0ocs3FVpXoPWXdHU4
GH386XqJ0YcqHIiMZi7M1i3pnQIrpIwpJkhTblznAHlfqRcUVtq5jza7sK+/eJQy
MTWbX1z4J649eByxyheT+ZucGDR0Hkw5TqEuJ8SlVkMHT/jW9hzhZbsI7Wa081k=
=VIGO
-----END PGP SIGNATURE-----


More information about the jbosstools-dev mailing list