2
votes

While trying to execute the tests on my project in play framework ? getting error :

Not found 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}*

any idea on how to resolve this error ?

I ran it like :

E:\My_Pro\protocms>play test

and then in the browser http://localhost:9000/@tests

The play frame work console shows :

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

Can any one please suggest any possible solution ?

1
Under the documentation routes you should see the test routes in the "Not Found" dialog. Your not running in test mode. - Drew H

1 Answers

4
votes

A couple of things to check.

When you run play in test mode, it should autimatically add the @tests routes to your route file, so I am skeptical of whether you are actually running in test mode.

Are you sure that your application is not running on a different port, and you are instead maybe accessing a different application?

What do you see when your application starts?? You should see something like the following.

~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ 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

Note the Running in test mode, and framework ID is test.