以下有时不起作用
@Test public void testBlah() throws Exception
我必须使用
@Test
public void testBlah() throws Exception
我想知道为什么?
最佳答案
我猜,因为在前者 Test
未导入,而当您按 <enter>
时这往往会在您不注意的情况下自动修复导入,并且您会觉得它不能在同一行上工作。
我想不出任何其他原因。
关于java - 为什么有时我必须将 @Test 放在单独的行中才能使其在 Eclipse 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5508706/