@Test public void shouldMatchIncludedCategoryInHierarchy() { GroupMatcher included = new SingleGroupMatcher( "org.apache.maven.surefire.common.junit48.tests.group.marker.CategoryC" ); GroupMatcher excluded = null; cut = new GroupMatcherCategoryFilter( included, excluded ); assertTrue( cut.shouldRun( createSuiteDescription( ABCTest.class ) ) ); assertTrue( cut.shouldRun( createSuiteDescription( BCTest.class ) ) ); assertFalse( cut.shouldRun( createSuiteDescription( ATest.class ) ) ); }
@Override public boolean shouldRun( Description description ) { if ( invalidTestClass( description ) ) { return shouldRun( description, null, null ); } if ( describesTestClass( description ) ) { Class<?> testClass = description.getTestClass(); return shouldRun( description, null, testClass ); } else { Class<?> testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } }
GroupMatcherCategoryFilter extends Filter { @Override public boolean shouldRun( Description description ) { if ( invalidTestClass( description ) ) { return shouldRun( description, null, null ); } if ( describesTestClass( description ) ) { Class<?> testClass = description.getTestClass(); return shouldRun( description, null, testClass ); } else { Class<?> testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } } }
GroupMatcherCategoryFilter extends Filter { @Override public boolean shouldRun( Description description ) { if ( invalidTestClass( description ) ) { return shouldRun( description, null, null ); } if ( describesTestClass( description ) ) { Class<?> testClass = description.getTestClass(); return shouldRun( description, null, testClass ); } else { Class<?> testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } } GroupMatcherCategoryFilter( GroupMatcher included, GroupMatcher excluded ); }
GroupMatcherCategoryFilter extends Filter { @Override public boolean shouldRun( Description description ) { if ( invalidTestClass( description ) ) { return shouldRun( description, null, null ); } if ( describesTestClass( description ) ) { Class<?> testClass = description.getTestClass(); return shouldRun( description, null, testClass ); } else { Class<?> testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } } GroupMatcherCategoryFilter( GroupMatcher included, GroupMatcher excluded ); @Override boolean shouldRun( Description description ); @Override String describe(); }
GroupMatcherCategoryFilter extends Filter { @Override public boolean shouldRun( Description description ) { if ( invalidTestClass( description ) ) { return shouldRun( description, null, null ); } if ( describesTestClass( description ) ) { Class<?> testClass = description.getTestClass(); return shouldRun( description, null, testClass ); } else { Class<?> testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } } GroupMatcherCategoryFilter( GroupMatcher included, GroupMatcher excluded ); @Override boolean shouldRun( Description description ); @Override String describe();  }