Java – can multiple categories be excluded from JUnit 4?

What I want to do is as follows:

@RunWith(Categories.class)
@Categories.IncludeCategory(Small.class)
@Categories.ExcludeCategory({Manual.class,NonFunctional.class})
@Suite.SuiteClasses(AllTests.class)
public class SmallTests {
}

But excludecategories accepts only one class, not an array of classes

Solution

This will be supported in JUnit version 4.12, see https://github.com/junit-team/junit/blob/master/src/main/java/org/junit/experimental/categories/Categories.java

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>