Question

At first I had difficulty attaching a debugger to FakeApplication instances created by my unit tests. Now I can see threads starting when my tests run, but breakpoints I set within Scala IDE in the test and in the tested code are ineffectual.

Is running two instances of Play and enabling jdwp in Test the usual way to debug unit tests?

Pas de solution correcte

Autres conseils

play runs the tests on a forked JVM by default, could this be the reason for your problems maybe? You can disable this in your project/Build.scala adding the setting Keys.fork in (Test) := false and then starting play with debug and attaching.

It looks something like this:

val main = play.Project(appName, appVersion, dependencies).settings(
  Keys.fork in (Test) := false
)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top