junit未使用最新文件 [英] junit not using the newest file
问题描述
我使用由maven自动安装的junit.当我运行Maven测试时,我的测试工作正常.但是,当我调用Eclipse JUnit测试时,它不使用测试版本的当前版本.
I use junit automatically installed by maven. When I run the maven test my tests work fine. But when I call the Eclipse JUnit test it doesn't use the current version of the test class.
例如如果将assertTrue()
更改为assertFalse()
,则会得到相同的结果.这让我发疯.
E.g. if I change a assertTrue()
into a assertFalse()
I get the same result. This is driving me crazy.
该项目的自动构建已打开.为什么JUnit使用一些旧的废话?
Automatic build for the project is on. Why does JUnit use some old crap?
感谢您的帮助.专家清洗和日食清洗解决了该问题.奇怪...
Thanks for the help. A maven clean and a eclipse clean fixed the problem. Weird...
推荐答案
Maven最有可能编译为./target/class,而Eclipse通常编译为./bin/classs.
Most possibly Maven compiles to ./target/classes while Eclipse usually compiles to ./bin/classes.
您应该尝试 http://m2eclipse.sonatype.org/ Eclipse插件,该插件有助于缓解压力Maven和Eclipse之间的区别.
You should try the http://m2eclipse.sonatype.org/ plugin for Eclipse that helps out easing the differences between Maven and Eclipse.
这篇关于junit未使用最新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!