赞
踩
解决方法:
ake sure your eclipse environment is using JUnit 4. JUnit 3 doesn't make use of annotations (it uses the old extends TestCase
style)
There are few things to double check:
Window > Preferences > Java > JUnit
Are you seeing junit4
or junit3
imports? If that looks good, make sure the project itself is using JUnit4 instead of JUnit3.
Right Click on project > Properties > Java Build Path > Libraries
Is JUnit4 included there? Is anything JUnit related there? If JUnit3 is in there, click on it and click Remove
. Then click Add Library...
and follow the prompts from there to add JUnit again.
mvn install
or whatever build target you have for Ant that'll run JUni
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。