【问题标题】:How to run JUnit test cases in play framework 2.3.2如何在 play framework 2.3.2 中运行 JUnit 测试用例
【发布时间】:2014-10-24 07:14:02
【问题描述】:

我已经制作了 play 应用程序的 eclipse 项目。我正在开发 java 应用程序,而不是使用 scala。

默认包下的测试源文件夹下有默认测试用例。类名是 ApplicationTest

我已阅读有关如何使用 JUnit 编写测试用例的信息。默认测试用例使用相同的方式编写。我使用激活器运行我的应用程序,但无法运行测试用例。找不到太多关于它的信息。

在激活器控制台测试命令显示 0 个测试用例。以下是输出

mindt@hridayesh:content-engine$ ./activator
[info] Loading project definition from /home/mindt/gitrepo/content-engine/project
[info] Set current project to Content-Engine (in build file:/home/mindt/gitrepo/content-engine/)
[Content-Engine] $ test
[info] Compiling 4 Java sources to /home/mindt/gitrepo/content-engine/target/scala-2.11/classes...
[success] Total time: 4 s, completed 30 Aug, 2014 6:03:50 PM
[Content-Engine] $ testOnly
[info] Compiling 4 Java sources to /home/mindt/gitrepo/content-engine/target/scala-2.11/classes...
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] No tests to run for test:testOnly
[success] Total time: 2 s, completed 30 Aug, 2014 6:03:55 PM
[Content-Engine] $ 

谢谢!

【问题讨论】:

    标签: junit playframework sbt playframework-2.3 typesafe-activator


    【解决方案1】:

    activator clean 的解决方案有时在 Eclipse 运行时不起作用。关闭 Eclipse 然后执行 activator clean 对我有用。

    【讨论】:

      【解决方案2】:

      激活器是否清洁并开始工作。

      ./activator clean
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-07
        • 2019-09-03
        • 2012-02-06
        • 1970-01-01
        • 2011-01-15
        相关资源
        最近更新 更多