简体   繁体   English

玩! Framework 2.2.0:无法在Eclipse中进行调试

[英]Play! Framework 2.2.0 : impossible to debug in Eclipse

I'm trying to debug my unit tests with Eclipse (Kepler), in a Play! 我正在尝试使用Eclipse(Kepler)在Play中调试我的单元测试! project. 项目。 I launched play debug . 我启动了play debug In Eclipse, I created a Remote Java Application in Debug Configurations with the port supplied by the output of the command line. 在Eclipse中,我使用命令行输出提供的端口在Debug Configurations中创建了一个远程Java应用程序。 Clicked Apply, then Debug, added breakpoints. 单击Apply,然后单击Debug,添加断点。 In the command prompt of my Play project, I launched test . 在我的Play项目的命令提示符中,我启动了测试 Eclipse never stops at the breakpoints. Eclipse永远不会在断点处停留。 It's very annoying. 这很烦人。 I'm on Windows 7 Pro 64bits. 我使用的是Windows 7 Pro 64位。

Thanks for your help 谢谢你的帮助

Add: 加:

val main = play.Project(appName, appVersion, appDependencies).settings(
   // Add your own project settings here
   Keys.fork in (Test) := false
)

in your Build.scala as explained here 在Build.scala作为解释这里

With command line in your Play! 使用Play中的命令行! project: 项目:

  • play clean 玩干净
  • play compile 玩编译
  • play debug 玩调试
  • (in eclipse) run your debug remote (在eclipse中)运行你的调试远程
  • test 测试

I just test it in Keppler, works fine for me ;) 我只是在凯普勒测试它,对我来说很好;)

Building on @Pierre-Yves' suggestion (I'm new to Play 2.2 and SBT, so this may be avoidable), to debug individual unit tests via IntelliJ I needed the following in build.sbt (thanks to Mike Slinn ): 基于@Pierre-Yves的建议(我是Play 2.2和SBT的新手,所以这可能是可以避免的),通过IntelliJ调试单个单元测试我需要build.sbt中的以下内容(感谢Mike Slinn ):

Keys.fork in Test := false

parallelExecution in Test := false

Without the build.sbt changes, executing the following in the Play debug console (each session) worked: 如果没有build.sbt更改,在Play调试控制台(每个会话)中执行以下操作:

$ set sbt.Keys.fork in Test := false

After either of those solutions, I could then set breakpoints and remote debug individual test classes via: 在这些解决方案中的任何一个之后,我可以通过以下方式设置断点并远程调试各个测试类:

$ test-only *package.class*

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

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