I recently worked with JUnit 3, but decided to upgrade to JUnit 4. Im now facing the following problem:
I used TestSuite with JUnit 3, where I ran all java-Testclasses whose names corresponded to a pattern like "* TestMe.java".
I have one hundred tests that have been named like this.
Now, with JUnit 4, I have to explicitly call them to call them in TestSuite.
@RunWith(Suite.class) @Suite.SuiteClasses( { FirstTestMe.class, SecondTestMe.class, ThirdTestMe.class, }) public class TestMe { private TestMe() { super(); } }
This is really inconvenient, and I may have forgotten to list some tests. Also, when I create a new one, I have to add it there.
Is there any solution how to call these test classes using Regex or something else?
Also, another question: should every method that is not a test, but can be used in a test class, be annotated using @Ignore? I run these test classes without any error, so I think this is not necessary?
nano7 source share