如何在play 2.0中编写功能测试

时间:2012-05-08 16:55:11

标签: playframework playframework-2.0

我正在尝试复制http://www.playframework.org/documentation/2.0.1/JavaFunctionalTest中可用的启动真实HTTP服务器示例,但是 如果游戏测试使用此助手

执行更多1 @Test
running(testServer(3333)

第二个@Test类将失败

这里是java stacktrace:

[error] Test controllers.v1_0.api.UsersTest.createAndRetreiveAndDeleteUser
failed: Promise timed out after 5000 : MILLISECONDS
[error]     at play.api.libs.concurrent.STMPromise$$anonfun$await$1.apply(Promise.scala:158)
[error]     at play.api.libs.concurrent.STMPromise$$anonfun$await$1.apply(Promise.scala:154)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.runBlock(InTxnImpl.scala:538)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.topLevelAttempt(InTxnImpl.scala:494)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.topLevelAtomicImpl(InTxnImpl.scala:365)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.atomic(InTxnImpl.scala:244)
[error]     at scala.concurrent.stm.ccstm.CCSTMExecutor.apply(CCSTMExecutor.scala:24)
[error]     at play.api.libs.concurrent.STMPromise.await(Promise.scala:154)
[error]     at play.api.libs.concurrent.Promise$class.await(Promise.scala:44)
[error]     at play.api.libs.concurrent.STMPromise.await(Promise.scala:113)
[error]     at play.api.libs.concurrent.Promise$class.value(Promise.scala:42)
[error]     at play.api.libs.concurrent.STMPromise.value(Promise.scala:113)
[error]     at play.libs.F$Promise.get(F.java:90)
[error]     at controllers.v1_0.api.UsersTest.createUserTest(UsersTest.java:50)
[error]     at controllers.v1_0.api.UsersTest.access$000(UsersTest.java:18)
[error]     at controllers.v1_0.api.UsersTest$1.run(UsersTest.java:25)
[error]     at play.test.Helpers.running(Helpers.java:317)
[error]     at controllers.v1_0.api.UsersTest.createAndRetreiveAndDeleteUser(UsersTest.java:22)

增加超时没有帮助。

感谢您的帮助, 安德烈

0 个答案:

没有答案