vendredi 29 mai 2015

How to run junits in play after Starting play application

I have a bunch of JUnit tests and wanted to execute them. The tests access my Play application host:port to call the REST API.

I use the following command to run the tests:

./activator  -Dhttp.port=8090 -Dhttps.port=8091  test

I also tried this way:

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

But the problem here is that the application is not started yet and JUnit test tries to connect to the Play app to access my rest API. I am not sure why test did not start the application.

How can I start my play app before the JUnit test are fired?

Now I can execute tests only when the app is started using Eclipse.

Please suggest!

Aucun commentaire:

Enregistrer un commentaire