• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic