我正在使用sbt版本0.13.2与纯java项目.
我build.sbt的内容如下:
libraryDependencies ++= Seq("com.novocode" % "junit-interface" % "0.10" % "test")
Run Code Online (Sandbox Code Playgroud)
我的测试看起来像这样:
import org.junit.Test;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.Assert.*;
@RunWith(JUnit4.class)
public class ExampleTest{
@Test
public void firstTest(){
org.junit.Assert.assertEquals("2.5 + 7.5 = 10.0", 2.5 + 7.5, 10.0, .1);
}
}
Run Code Online (Sandbox Code Playgroud)
当我sbt test从命令行执行操作时,测试已成功编译,但测试未运行.它说
Compiling 1 Java source to [my path]/target/scala-2.10/test-classes...
...
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[success] Total time: 1 s, completed May 31, 2014 5:56:22 PM
Run Code Online (Sandbox Code Playgroud)
知道如何执行测试吗?
| 归档时间: |
|
| 查看次数: |
2946 次 |
| 最近记录: |