You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Abstract test suite in a shared project:
@RunWith(WildcardPatternSuite.class)
@SuiteClasses("**/*Test.class")
@ExcludeCategories({ SlowTests.class })
public abstract class AbstractAllNonSlowTestSuite {
}
2. Concrete test suite in each concrete project extending from the shared
abstract one:
public class AllNonSlowTestSuite extends AbstractAllNonSlowTestSuite { }
3. Test class with 1 slow test:
public class With1SlowTest_Test {
@Test
public void a() {
fail();
}
@Category(SlowTests.class)
@Test
public void testSlow() {
fail();
}
}
What is the expected output? What do you see instead?
I think because IncludeCategories annotation is not annotated with @Inherited,
With1SlowTest_Test.testSlow() is not filtered/excluded when executing
AllNonSlowTestSuite.
What version of the product are you using? On what operating system?
1.8
Please provide any additional information below.
I was trying this approach with abstract test suite with whole configuration to
avoid a little bit of duplication in each project's test suite. I hope I have
not missed anything.
Original issue reported on code.google.com by reinhold...@googlemail.com on 31 Mar 2014 at 1:34
The text was updated successfully, but these errors were encountered:
Probably according to the principle of the least surprise, the annotations
@ExcludeCategories and @IncludeCategories are configured like their JUnit
companions @IncludeCategory, @ExcludeCategory.
Reinhold, I agree @Inherited is meaningful. Or is there a way to apply
composition over inheritance?
By the way, I believe not earlier than in the newest SNAPSHOT version of JUnit
11, @Category is annotated with @Inherited. I don't understand why this
annotation wasn't added from the beginning. The JUnit guys do not seem to like
@Inherited.
Original comment by rwoo@gmx.de on 2 May 2014 at 3:13
Thanks for your comments: I must admit that keeping consistency/similarity with
JUnit sounds like a good argument too.
ad "composition over inheritance": Frankly I don't know of any applicable
approach (that would be also nice or non-ugly).
=> Thus, I am okay with every/either decision you take (adding @Inheritance vs.
resolving issue with won't fix)
Original comment by reinhold...@googlemail.com on 12 May 2014 at 11:47
As rwoo@gmx.de suggested I would rather not add @Inherited to IncludeCategories
and ExcludeCategories as long as the original JUnit annotations
Categories.IncludeCategory and Categories.ExcludeCategory do not have the
@Inherited annotation.
Original comment by michael.tamm2 on 16 Jun 2014 at 8:01
Original issue reported on code.google.com by
reinhold...@googlemail.com
on 31 Mar 2014 at 1:34The text was updated successfully, but these errors were encountered: