play framework 2.1 junit test not working from eclipse

我与影子孤独终老i 提交于 2019-11-29 09:18:15

There is blog post about setting up unit tests to run in IDEs. It suggests to add following command-line to java used when running tests:

-javaagent:/path/to/ebean/ebean-2.7.3-agent.jar

Seems that Play not ships with ebean agent, it should be downloaded from Ebean website first (in main ebean package).

I not tried it.

Ebean user guide also mentions it (15.5.2 javaagent section), there is even example for configuring Eclipse.

Also, to speed up enhancement maybe this will be better:

-javaagent:/path/to/ebean/ebean-2.7.3-agent.jar;packages=models.*

So it will only look into models.* (default package for ORM models in Play).

You can use the Avaje Ebean Eclipse Plugin:

http://www.avaje.org/eclipseupdate/site.xml

After the installation, activate Ebean enhancement by right clicking on your project and selecting Enable Ebean Enhancement.

i got this error when i tried to remove the public modifier from the declaration of one of classes extending Model.

i was using a model to make a "through" table (a many to many relationship with additional information), so protected access makes sense. perhaps there's another way to do this, but the play javadoc is pretty sparse.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!