我编写了几个 JUnit 测试方法来测试我的 Java Swing GUI(使用FEST)。我的课程采用以下格式:
public class Tests
{
@BeforeClass
public static void beforeClass() throws Exception { ... }
@Before
public void before() throws Exception { ... }
@After
public void after() throws Exception { ... }
@AfterClass
public static void afterClass() throws Exception { ... }
@Test
public void testA() { ... }
@Test
public void testB() { ... }
@Test
public void testC() { ... }
}
当我在 Eclipse 中运行这个类时,它只运行 testA 测试,而不运行 testB 或 testC。如果我注释掉 testA,testB 就会运行 - 所以它似乎每次只运行第一个测试。
Eclipse 中的 JUnit 在完成第一次测试后显示“运行:2/3”,但没有进一步进展,或显示任何错误。
有什么我做错了吗?我正在使用 JUnit 4.8.1 和 FEST 1.2。