Reputation: 177
Is it possible to run only some methods (not all) from a test case in Junit4 (Eclipse)? I have 2 test cases and I want to implement a test suite which contains all the methods from one test case (I did that by adding the @Category annotation to all the tests from the first test case and then in the suite i used @IncludeCategory) and some methods from the second one.
Thank you!
Upvotes: 2
Views: 77
Reputation: 3717
Yes, it is possible. Just put the @Category
annotation containing the same marker:
...and include that category within your suite.
I believe that first SlowTestSuite
class from an example in Category documentation shows the situation you've asked about - it runs all tests from B
and only some from A
.
Upvotes: 0