Reputation: 1015
I'm trying to debug my unit tests with Eclipse (Kepler), in a Play! project. I launched play debug. In Eclipse, I created a Remote Java Application in Debug Configurations with the port supplied by the output of the command line. Clicked Apply, then Debug, added breakpoints. In the command prompt of my Play project, I launched test. Eclipse never stops at the breakpoints. It's very annoying. I'm on Windows 7 Pro 64bits.
Thanks for your help
Upvotes: 5
Views: 1986
Reputation: 41
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):
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:
$ 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*
Upvotes: 4
Reputation: 141
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
With command line in your Play! project:
I just test it in Keppler, works fine for me ;)
Upvotes: 5