不要扩展TestCase并同时使用注释!
如果需要使用批注创建测试套件,请使用RunWith批注,例如:
@RunWith(Suite.class)@Suite.SuiteClasses({ MyTests.class, OtherTest.class })public class AllTests { // empty}public class MyTests { // no extends here @BeforeClass public static void setUponce() throws InterruptedException { ... @Test ...(按照惯例:类名带有大写字母)



