端末sbt -jvm-debug 9999
で次のコマンドを実行し、Intellij 15.0.4-1のデフォルト値でリモートデバッグを開始します。次に、sbtタスクrun
を実行し、ブレークポイントが期待通りに機能します。 test
タスクを実行すると、代わりに同じコードが実行されたにもかかわらず、デバッグはもう機能しません。SBTリモートデバッグはintellijでは動作しますが、テスト実行時には動作しません
play-scala
活性化種子をPlay Framework 2.4
と使用する。テストはspec2で書かれています。 誰かが私が間違っているかもしれないアイデアはありますか?ここで
object DebugTest {
def helloWorld(): Unit ={
println("Oh my")
}
}
クラスApplicationSpec.scala
クラスDebugTest.scala
import org.specs2.mutable._
import play.api.test._
import play.api.test.Helpers._
class ApplicationSpec extends Specification {
"Application" should {
"just print oh my in console" in new WithApplication{
DebugTest.helloWorld()
}
}
}
ファイル
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(jdbc,
ws,
specs2 % Test,
"org.webjars.bower" % "adminlte" % "2.3.3",
"org.pac4j" % "play-pac4j" % "2.2.0-SNAPSHOT",
"org.pac4j" % "pac4j-http" % "1.9.0-SNAPSHOT",
"com.typesafe.play" % "play-cache_2.11" % "2.4.6"
)
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
resolvers += "Sonatype snapshots repository" at "https://oss.sonatype.org/content/repositories/snapshots/"
routesGenerator := InjectedRoutesGenerator
fork in run := true
fork in test := false
ファイルtest.sbt build.sbt
fork in test := false
私の質問が更新されました。私は追加のtest.sbtを追加するあなたの提案を試みたが、まだデバッグが機能しません。 –
私のエラーは 'Test'の代わりに' test'を書いたことです。すべてが今働きます!どうもありがとうございます。 –