简体   繁体   English

如何设置IntelliJ 13以在Play Framework项目中编译junit测试

[英]How to setup IntelliJ 13 to compile junit tests in Play Framework project

I created new Play framework 2.3.4 project with IntelliJ IDEA 13, everything works fine except for unit tests. 我使用IntelliJ IDEA 13创建了新的Play框架2.3.4项目,除了单元测试外,一切正常。 When I create a test and run it intelliJ says: 当我创建一个测试并运行它时,intelliJ说:

Class not found: "myclass" 

When I run activator test it compiles the class and I can then run it from intelliJ, but I would like to solve this issue because running activator after every change in test is very uncomfortable. 当我运行激活器测试时,它编译类,然后我可以从intelliJ运行它,但我想解决这个问题,因为在每次测试更改后运行激活器都非常不舒服。

Neither turning of external build server or updating play and intelliJ to latest version didn't help. 无论是转动外部构建服务器还是将play和intelliJ更新到最新版本都无济于事。

Did you manage to solve this issue? 你有设法解决这个问题吗?

Go to "Run/Debug Configurations" of your unit test and change "Use classpath of module" to "root" module and set "Make Project" in Before launch section. 转到单元测试的“运行/调试配置”,将“使用模块的类路径”更改为“根”模块,并在“启动前”部分中设置“生成项目”。 At least it helped me to solve the same error. 至少它帮助我解决了同样的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM