kas*_*ere 6 java junit netbeans
我通常不会遇到JUnit注释的问题.但不知怎的,今天,在我新安装的Netbeans 7.2中,当我使用@Before注释时遇到以下错误:
annotation before is missing value for the attribute value
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这一问题?
UPDATE
我正在写一个mavenized web-app.对于TestCase,当我尝试导入org.junit.Before程序而不是导入时org.aspectj.lang.annotation.Before
小智 9
即使在pom.xml.
检查您是否正在导入正确的库,即
import org.junit.Before;
Run Code Online (Sandbox Code Playgroud)
代替
import org.aspectj.lang.annotation.Before;
Run Code Online (Sandbox Code Playgroud)
您是否声明对最新JUnit版本的依赖?
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
你应该能够导入正确的类:org.junit.Before.
| 归档时间: |
|
| 查看次数: |
4025 次 |
| 最近记录: |