【发布时间】:2015-05-29 05:56:25
【问题描述】:
我有一堆 JUnit 测试并想执行它们。测试访问我的 Play 应用程序 host:port 以调用 REST API。
我使用以下命令运行测试:
./activator -Dhttp.port=8090 -Dhttps.port=8091 test
我也试过这种方式:
D:\sigma-idp\auth>activator -Dhttp.port=8090 -Dhttps.port=8091
[info] Loading project definition from D:\sigma-idp\auth\project
[info] Set current project to auth (in build file:/D:/sigma-idp/auth/)
[auth] $ test
但这里的问题是应用程序尚未启动,JUnit 测试尝试连接到 Play 应用程序以访问我的 REST API。我不确定为什么 test 没有启动应用程序。
如何在触发 JUnit 测试之前启动我的 play 应用程序?
现在我只能在使用 Eclipse 启动应用程序时执行测试。
请推荐!
【问题讨论】:
标签: java junit playframework playframework-2.0