Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试使用 Ant 进行单元测试时遇到问题,我的测试类使用 Jmock;
@RunWith(JMock.class)
和注释以识别每种测试方法。当我尝试使用 ant (1.7.1) 构建时,我得到一个
[junit] 在 MyTestClass 中未找到测试 [junit] junit.framework.AssertionFailedError:未找到测试
有什么建议么?
您使用的是哪个版本的 JUnit?对我来说它看起来像 3.8(虽然我可能弄错了)但是 JUnit 4.x 的包结构是:org.junit而不是junit.framework
org.junit
junit.framework
JMock 家伙定义的@RunWith跑步者仅对 JUnit 4.x 有效
@RunWith
如果您使用的是 JUnit 3,则应该从 MockObjectTestCase 继承而不是使用 Runner