pmckeown
pmckeown

Reputation: 4199

Run Only Subclasses of a Type in an Ant JUnit test run

Hi is it possible with Ant to define a target that will only run JUnit tests that are a subclass of a given type.

The scenario is: in the project I have joined we have a large number of Integration tests that are not run separately from the Unit tests, and I'd like to define an Ant task to run them in a separate build stage from the unit tests, and ultimately in a separate Jenkins build. However, there are no naming or packaging conventions for these Integration Tests so the standard Ant path matching won't work in this scenario.

What I think I need to achieve what I want, is a task def that will allow me to say something like:

<include name="? extends IntegrationBaseTest"/>

This is obviously a contrived example, but I belive it communicates what I want.

Has anyone implemented something like this or is it possible with Ant out-of-the-box?

Upvotes: 1

Views: 150

Answers (1)

hoipolloi
hoipolloi

Reputation: 8044

I don't think you can do this with Ant. Perhaps JUnit categories can help segregate your tests.

Upvotes: 1

Related Questions