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); } } }
/** * 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. } } }