aspose file tools*
The moose likes Testing and the fly likes How to create a new suit with only selected tests from other suite Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "How to create a new suit with only selected tests from other suite" Watch "How to create a new suit with only selected tests from other suite" New topic
Author

How to create a new suit with only selected tests from other suite

Swapnil Sapar
Ranch Hand

Joined: Sep 29, 2003
Posts: 41
Hi,

I have been searching abt this for a while now. Could not find any good answer.
I'm using JUnit 4.8.1 but can go to JUnit 3 if I have too.

Here is my problem:

I have 3 test suites each containing 11, 12, 13 tests in it. CarTestSuite, CycleTestSuite, BoatTestSuite
Now I wish to create a new suite SanityReverseTestSuite containing only 3 tests. These tests are handpicked from the each of the above suites.
I know one I include all 3 suites into one using @Suite.SuiteClasses annotation but it would include *ALL* tests from these suite whereas I'm looking for including only ONE test from each of these suite.
Any tips/suggestions?



Cheers!
Swapnil


SCJP 1.4 (90%), SCWCD 1.4 (92%)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

In JUnit 3.8, you just need create a suite as shown in the JavaDoc:


I don't know of a way to do what you want in JUnit 4 other than by extending JUnit itself. It would be easier to refactor the tests to be in different classes though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
jQuery in Action, 2nd edition
 
subject: How to create a new suit with only selected tests from other suite