我通常不会遇到 JUnit 注释的问题。但不知何故,在我新安装的 Netbeans 7.2 中,当我使用 @Before
注释时遇到以下错误:
annotation before is missing value for the attribute value
有人知道如何解决这个问题吗?
更新
我正在编写一个 mavenized 网络应用程序。
对于 TestCase,当我尝试导入 org.junit.Before
时,程序改为导入 org.aspectj.lang.annotation.Before
最佳答案
即使在 pom.xml
中添加了 junit 依赖项,您仍然遇到相同的错误吗?
检查您是否正在导入正确的库,即
import org.junit.Before;
代替
import org.aspectj.lang.annotation.Before;
关于java - 之前的注释缺少属性值的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12575271/