Java测试没有运行示例应用程序?

时间:2013-08-15 20:16:39

标签: junit4 playframework-2.1

我正在尝试示例app计算机数据库,然后运行'play test'。没有测试正在运行。我正在使用play 2.1.3。

https://github.com/playframework/playframework/tree/2.1.x/samples/java/computer-database/test

$ play

 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.3 (using Java 1.7.0_25 and Scala 2.10.0), http://www.playframework.org



$ play test
[info] FunctionalTest
[info] 
[info] 
[info] Total for test FunctionalTest
[info] Finished in 0.009 seconds
[info] 0 tests, 0 failures, 0 errors
[info] ModelTest
[info] 
[info] 
[info] Total for test ModelTest
[info] Finished in 0.001 seconds
[info] 0 tests, 0 failures, 0 errors
[info] IntegrationTest
[info] 
[info] 
[info] Total for test IntegrationTest
[info] Finished in 0.0 seconds
[info] 0 tests, 0 failures, 0 errors

1 个答案:

答案 0 :(得分:1)

这是2.1.3中的错误。这是解决方法。 http://play.lighthouseapp.com/projects/82401/tickets/967-tests-are-not-discovered

将此添加到您的依赖项:

"play" %% "play-test" % play.core.PlayVersion.current % "test" exclude("com.novocode", "junit-interface"),
"com.novocode" % "junit-interface" % "0.9" % "test"