Jør*_*ogh 15 eclipse junit unit-testing scala
我正在学习Scala,并希望在Eclipse中设置集成单元测试.据我所知,通过谷歌搜索,ScalaTest是可行的方式,可能与JUnit结合使用.
您在Eclipse中对Scala进行单元测试的经历是什么?我应该使用JUnit跑步者还是其他什么?
我无法在eclipse中使用JUnit runner运行ScalaTest规范.我认为这是因为没有@Test
注释方法.但是,如果您的项目具有Maven支持,则可以使用命令行运行规范mvn test
.要使用Surefire插件检测您的规格,请在您的pom文件中使用以下配置.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<includes>
<include>**/*Spec.class</include>
</includes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
查看这些示例以供参考.
归档时间: |
|
查看次数: |
9237 次 |
最近记录: |