File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Add testSuites to other test suites? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Add testSuites to other test suites?" Watch "Add testSuites to other test suites?" New topic
Author

Add testSuites to other test suites?

Ryan Day
Ranch Hand

Joined: Apr 03, 2006
Posts: 87
I'm getting an error when I try to create a top-level Junit test suite that will call multiple other test suites.

I am trying to create a JUnit test suite "AllTests" that contains all of the TestSuites in other packages.

The lower-level AllTests looks like this (with package and class names changed to samples):



Here is the higher level test suite I created:



The low level test suites run fine, but when I try to run the higher level test suite, I get the following error:



junit.framework.AssertionFailedError: No tests found in com.sample.business.AllTests


SCJP, SCWCD
Rodrigo Lopes
Ranch Hand

Joined: Feb 29, 2008
Posts: 119
One guess:

com.sample.business.AllTests has to extend TestSuite
[ June 05, 2008: Message edited by: Rodrigo Lopes ]
Ryan Day
Ranch Hand

Joined: Apr 03, 2006
Posts: 87
>>One guess: com.sample.business.AllTests has to extend TestSuite

Tried this. Still no luck.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
In the higher level suite, you need to add "AllTests.suite()" and not "AllTests.class".


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ryan Day
Ranch Hand

Joined: Apr 03, 2006
Posts: 87
Thank you both for your help. Here is the working "suite of suites":


[ June 06, 2008: Message edited by: Ryan Day ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add testSuites to other test suites?