Java 类org.junit.experimental.categories.Categories 实例源码

项目:intellij-ce-playground    文件:IdeaSuite48.java   
private void filterByCategory(Class category) throws InitializationError {
  if (category != null) {
    try {
      final Categories.CategoryFilter categoryFilter = Categories.CategoryFilter.include(category);
      filter(categoryFilter);
    } catch (NoTestsRemainException e) {
      throw new RuntimeException(e);
    }
  }
}
项目:spring-ldap    文件:LdapConditionallyFilteredTestRunner.java   
/**
 * Constructs a new {@code SpringJUnit4ClassRunner} and initializes a
 * {@link org.springframework.test.context.TestContextManager} to provide Spring testing functionality to
 * standard JUnit tests.
 *
 * @param clazz the test class to be run
 * @see #createTestContextManager(Class)
 */
public LdapConditionallyFilteredTestRunner(Class<?> clazz) throws InitializationError {
    super(clazz);

    String noadtest = System.getProperty("adtest");
    if (noadtest != null) {
        try {
            filter(Categories.CategoryFilter.exclude(NoAdTest.class));
        } catch (NoTestsRemainException e) {
            // Nothing to do here.
        }
    }
}