Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add testSuites to other test suites?

 
Ryan Day
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rodrigo Lopes
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One guess:

com.sample.business.AllTests has to extend TestSuite
[ June 05, 2008: Message edited by: Rodrigo Lopes ]
 
Ryan Day
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>One guess: com.sample.business.AllTests has to extend TestSuite

Tried this. Still no luck.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the higher level suite, you need to add "AllTests.suite()" and not "AllTests.class".
 
Ryan Day
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for your help. Here is the working "suite of suites":


[ June 06, 2008: Message edited by: Ryan Day ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic