JUnitMatcher implements IMatcher { @Override public boolean matches(final CtClass ctClass) { return this.matcher.matches(ctClass); } JUnitMatcher(); @Override boolean matches(final CtClass ctClass); @Override boolean matches(final CtBehavior ctBehavior); @Override boolean matches(final CtField ctField); final IMatcher matcher; }
@Test public void testAbstractClass() throws Exception { JUnitMatcher matcher = new JUnitMatcher(); CtClass ctClass = pool.get(AbstractTestClass.class.getName()); assertFalse(matcher.matches(ctClass)); }
@Test public void testChildTestClassWithoutTestCases() throws Exception { JUnitMatcher matcher = new JUnitMatcher(); CtClass ctClass = pool.get(ChildTestClassWithoutTestCases.class.getName()); assertTrue(matcher.matches(ctClass)); }
@Test public void testChildTestClassWithTestCases() throws Exception { JUnitMatcher matcher = new JUnitMatcher(); CtClass ctClass = pool.get(ChildTestClassWithTestCases.class.getName()); assertTrue(matcher.matches(ctClass)); }
@Test public void testJUnitClassWithInnerClass() throws Exception { JUnitMatcher matcher = new JUnitMatcher(); CtClass ctClass = pool.get(JUnitClassWithInnerClass.class.getName()); assertTrue(matcher.matches(ctClass)); ctClass = pool.get(SomeStaticInnerClass.class.getName()); assertTrue(matcher.matches(ctClass)); }