【问题标题】:Play framework test error播放框架测试错误
【发布时间】:2011-10-24 10:39:24
【问题描述】:

尝试在游戏框架中对我的项目执行测试时?出现错误:

未找到 GET /@tests

*These routes have been tried, in this order :
GET       /@documentation/cheatsheet/{category}             PlayDocumentation.cheatSheet
GET       /@documentation/modules/{module}/files/{name}     PlayDocumentation.file
GET       /@documentation/modules/{module}/images/{name}    PlayDocumentation.image
GET       /@documentation/modules/{module}/{id}             PlayDocumentation.page
GET       /@documentation/files/{name}                      PlayDocumentation.file
GET       /@documentation/images/{name}                     PlayDocumentation.image
GET       /@documentation/{id}                              PlayDocumentation.page
GET       /@documentation/?                                 PlayDocumentation.index
GET       /                                                 Application.index
GET       /favicon.ico                                      404
GET       /public/                                          staticDir:public
*         /{controller}/{action}                            {controller}.{action}*

关于如何解决此错误的任何想法?

我是这样运行的:

E:\My_Pro\protocms>play test

然后在浏览器中http://localhost:9000/@tests

播放框架工作控制台显示:

~ play! 1.2.2, http://www.playframework.org
~ framework ID is test
~
~ Running in test mode
~ Ctrl+C to stop  
Listening for transport dt_socket at address: 8000
Module morphia is available (E:\My_Pro\play_framewrk\play-1.2.2\modules\morphia-1.2.3beta1)
  You're running Play! in DEV mode
Listening for HTTP on port 9000 (Waiting a first request to start) ...

com.google.code.morphia.logging.MorphiaLoggerFactory chooseLoggerFactory
INFO: LoggerImplFactory set to com.google.code.morphia.logging.jdk.JDKLoggerFactory
17:26:00,906 INFO  ~ Connected to jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0
17:26:01,062 INFO  ~ MorphiaPlugin-1.2.3beta1> initialized
17:26:01,062 INFO  ~ MorphiaPlugin-1.2.3beta1> loaded
17:26:01,125 INFO  ~ Application 'ProtoCMS' is now started !

任何人都可以提出任何可能的解决方案吗?

【问题讨论】:

  • 在文档路线下,您应该在“未找到”对话框中看到测试路线。您没有在测试模式下运行。

标签: playframework


【解决方案1】:

有几件事要检查。

当你在测试模式下运行播放时,它应该自动将@tests 路由添加到你的路由文件中,所以我怀疑你是否真的在测试模式下运行。

您确定您的应用程序没有在不同的端口上运行,而是您可能正在访问不同的应用程序?

您的应用程序启动时会看到什么?您应该会看到类似以下内容。

~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2, http://www.playframework.org
~ framework ID is test
~
~ Running in test mode
~ Ctrl+C to stop
~
Listening for transport dt_socket at address: 8000
13:50:04,041 INFO  ~ Starting C:\PlayFramework\play-1.2\bics
13:50:04,947 WARN  ~ You're running Play! in DEV mode
~
~ Go to http://localhost:9000/@tests to run the tests
~
13:50:05,275 INFO  ~ Listening for HTTP on port 9000 (Waiting a first request t
 start) ...
13:50:26,276 INFO  ~ Connected to jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0

注意Running in test mode 和framework ID is test。

【讨论】:

  • 我的游戏控制台上出现以下问题:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-19
  • 1970-01-01
  • 1970-01-01
  • 2016-02-16
相关资源
最近更新 更多