I want to include multiple categories for a junit runner.
Java Code
@RunWith(Categories.class)
@IncludeCategory(IMAP.class , POP.class)
@SuiteClasses({MailTestSuites.class})
public class TestSuiteRunner{
}
I want to run my test suite for these two categories only. I have categories for mail suite like "IMAP,POP , SMTP , POP3". Now , I want to run only "IMAP , POP" category suites only. How can I run with junit?
No, you couldn't define multiple values of
@IncludeCategory
in oneCategories
.I recommend you use multiple
Categories
to run your test cases. (Separate IMAP and POP test cases)Up to version JUnit 4.11,
@IncludeCategory
and@ExcludeCategory
only support one value. However, starting with the upcoming release 4.12, it will be allowed to pass multiple values.According to the documentation in the source code, you can then write: