Running Multiple JUnit Suites

We have several modules each with it's own Suite of JUnit tests.  Is it possible to run multiple suites at once in JUnit?  I've browsed the documentation and the plugins and I don't see anything, but I'm hoping that maybe I missed something.  To clarify I have two unrelated classes as follows:

@SuiteClasses({

MyTest1.class,

MyTest2.class

})

public class MyTestSuiteOne {}


And I also have:

@SuiteClasses({

MyTest3.class,

MyTest4.class

})

public class MyTestSuiteTwo {}

Before I commit code I have to run each of these suites independently, but I'd prefer to run 1 time and it encompass all of the tests.  Obviously I could have another master suite which contained all the classes, but I think that would be too cumbersome to maintain.  Thanks in advance!

2 comments

You could:

1. Create a super suite (as you already mentioned)

2. IDEA allows you to run all the tests in a directory

3. Use Ant, SBT, Maven, etc and run the tests as part of a build.

(I generally use #3, I don't like #1)

On 10/14/10 2:27 AM, Johnny Clark wrote:

We have several modules each with it's own Suite of JUnit tests.  Is it possible to run multiple suites at once in JUnit?  I've browsed the documentation and the plugins and I don't see anything, but I'm hoping that maybe I missed something.  To clarify I have two unrelated classes as follows:

>

@SuiteClasses({
MyTest1.class,
MyTest2.class
})

>

public class MyTestSuiteOne {}

>

And I also have:

>

@SuiteClasses({
MyTest3.class,
MyTest4.class

>

})

>

public class MyTestSuiteTwo {}

>

Before I commit code I have to run each of these suites independently, but I'd prefer to run 1 time and it encompass all of the tests.  Obviously I could have another master suite which contained all the classes, but I think that would be too cumbersome to maintain.  Thanks in advance!


0

Donald:

Thanks for the info!

- Johnny

0

Please sign in to leave a comment.