2011-10-24 119 views
2

试图在我的项目在播放框架中执行测试?收到错误:播放框架测试错误

找不到 GET/@测试

*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 ! 

任何一个可以请提出任何可能的解决方案?

+0

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

回答

4

有几件事要检查。

当您在测试模式下运行播放时,它应该自动将@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

+0

我在我的游戏控制台上获得下面的东西: – user988679