【发布时间】:2010-11-08 09:00:18
【问题描述】:
是否有推荐的方法将 Hamcrest 集成到 Eclipse 中的 JUnit 配置中?目前 Eclipse 的 JUnit 仅带有 Hamcrest-core。我想编辑该配置以包含 Hamcrest-all。我该怎么做?
【问题讨论】:
标签: eclipse configuration junit hamcrest
是否有推荐的方法将 Hamcrest 集成到 Eclipse 中的 JUnit 配置中?目前 Eclipse 的 JUnit 仅带有 Hamcrest-core。我想编辑该配置以包含 Hamcrest-all。我该怎么做?
【问题讨论】:
标签: eclipse configuration junit hamcrest
我在使用 hamcrest-all 和 junit-dep 时遇到问题 - 然后您需要 jMock、easymock 和 ant.tasks
如果您只需要更多匹配器,请添加 hamcrest-library(以及您从 Eclipse 获得的 junit 和 hamcrest 核心)
这个问题不应该有“hamcrest”标签吗?
【讨论】:
JUnit 分为两个 distributions:带 Hamcrest (junit-4.6.jar) 和不带 Hamcrest (junit-dep-4.6.jar)。如果我正确理解您的问题,您需要在 JUnit 配置中指定 junit-4.6.jar。我认为在 Eclipse 中是可能的(我使用另一个 IDE)。
【讨论】:
没有什么可以阻止您将 hamcrest 作为 JAR 添加到 Eclipse 项目的构建路径中。如果有一个与 eclipse 一起打包的(我没有意识到有,但很公平),那么它只是为了方便。
【讨论】: