我正在使用IntelliJ Ultimate 2019.2,我的测试可以从命令行使用SBT正常运行,但是使用ScalaTest配置并勾选了SBT选项可以在IntelliJ中运行它们:
测试框架意外退出
,并在控制台中显示:
Testing started at 13:27 ...
initialize
[IJ][academy-residences] $
[IJ][academy-residences] $ show {file:/C:/Users/Oliver/Workspace/academy- residences/}root/test:testOptions
[info] * Argument(Some(TestFramework(org.specs2.runner.Specs2Framework, org.specs2.runner.SpecsFramework)),List(sequential, true, junitxml, console))
[info] * Argument(Some(TestFramework(com.novocode.junit.JUnitFramework)),List(--ignore-runners=org.specs2.runner.JUnitRunner))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[info] * Argument(Some(TestFramework(org.scalatest.tools.Framework, org.scalatest.tools.ScalaTestFramework)),List(-oDU))
[success] Total time: 0 s, completed 9 Sep 2019, 13:27:22
[IJ][academy-residences] $
[IJ][academy-residences] $ set testOptions.in(ProjectRef(uri("file:/C:/Users/Oliver/Workspace/academy-residences/"), "root")) in Test+=Tests.Argument(TestFrameworks.ScalaTest, "-oDU")
[info] Defining Test / testOptions
[info] The new value will be used by Test / test / testOptions, Test / testOnly / testOptions, Test / testQuick / testOptions
[info] Reapplying settings...
[info] Set current project to academy-residences (in build file:/C:/Users/Oliver/Workspace/academy-residences/)
[IJ][academy-residences] $
[IJ][academy-residences] $ show {file:/C:/Users/Oliver/Workspace/academy-residences/}root/test:parallelExecution
[info] false
[IJ][academy-residences] $
[IJ][academy-residences] $ set parallelExec
我可以查看某个地方的日志文件以了解发生了什么事吗?
idea.log示例如下:
2019-09-09 15:02:02,782 [7334124] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\Oliver\Workspace\academy-residences' academy-residenceslibraryTable took 31 ms
2019-09-09 15:02:02,831 [7334173] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 208 ms
2019-09-09 15:02:21,726 [7353068] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in 'BookingDAO' content in Run tool window to avoid focus-related problems.
2019-09-09 15:02:21,726 [7353068] WARN - j.openapi.wm.impl.IdeFrameImpl - BookingDAO tool window - parent container is hidden
2019-09-09 15:02:28,635 [7359977] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\Oliver\Workspace\academy-residences' academy-residenceslibraryTable took 28 ms
2019-09-09 15:02:28,719 [7360061] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2019-09-09 15:02:29,416 [7360758] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA 2019.2/plugins/java/lib/jps-launcher.jar
2019-09-09 15:02:29,551 [7360893] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2019-09-09 15:02:29,551 [7360893] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation
2019-09-09 15:02:29,552 [7360894] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2019-09-09 15:02:30,567 [7361909] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: An illegal reflective access operation has occurred
2019-09-09 15:02:30,567 [7361909] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/C:/Program%20Files/JetBrains/IntelliJ%20IDEA%202019.2/lib/protobuf-java-3.5.1.jar) to field java.nio.Buffer.address
2019-09-09 15:02:30,567 [7361909] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
2019-09-09 15:02:30,567 [7361909] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2019-09-09 15:02:30,568 [7361910] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: WARNING: All illegal access operations will be denied in a future release
2019-09-09 15:02:30,624 [7361966] INFO - .ScalaCompilerReferenceService - [compiler indices] onCompilationStart. active indexing phases: 1
2019-09-09 15:02:33,714 [7365056] INFO - .ScalaCompilerReferenceService - [compiler indices] startIndexing. clean build: false
2019-09-09 15:03:13,127 [7404469] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: java.net.URISyntaxException: Illegal character in opaque part at index 14: jrt:C:/Program Files/JetBrains/IntelliJ IDEA 2019.2/jbr
2019-09-09 15:03:13,130 [7404472] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at java.base/java.net.URI$Parser.fail(URI.java:2915)
2019-09-09 15:03:13,130 [7404472] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at java.base/java.net.URI$Parser.checkChars(URI.java:3086)
2019-09-09 15:03:13,130 [7404472] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at java.base/java.net.URI$Parser.parse(URI.java:3122)
2019-09-09 15:03:13,130 [7404472] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at java.base/java.net.URI.<init>(URI.java:600)
2019-09-09 15:03:13,130 [7404472] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at java.base/java.net.URL.toURI(URL.java:1018)
2019-09-09 15:03:13,131 [7404473] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getLoader(InstrumentationClassFinder.java:539)
2019-09-09 15:03:13,131 [7404473] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getLoader(InstrumentationClassFinder.java:520)
2019-09-09 15:03:13,131 [7404473] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumentationClassFinder$ClassFinderClasspath.getResource(InstrumentationClassFinder.java:486)
2019-09-09 15:03:13,131 [7404473] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumentationClassFinder.getClassBytesStream(InstrumentationClassFinder.java:183)
2019-09-09 15:03:13,131 [7404473] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumentationClassFinder.loadClass(InstrumentationClassFinder.java:132)
2019-09-09 15:03:13,132 [7404474] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.instrumentation.InstrumenterClassWriter.getCommonSuperClass(InstrumenterClassWriter.java:27)
2019-09-09 15:03:13,132 [7404474] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.SymbolTable.addMergedType(SymbolTable.java:1198)
2019-09-09 15:03:13,132 [7404474] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.Frame.merge(Frame.java:1295)
2019-09-09 15:03:13,132 [7404474] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.Frame.merge(Frame.java:1176)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.MethodWriter.computeAllFrames(MethodWriter.java:1617)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1553)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:768)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:768)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at com.intellij.compiler.notNullVerification.NotNullVerifyingInstrumenter$2.visitMaxs(NotNullVerifyingInstrumenter.java:329)
2019-09-09 15:03:13,133 [7404475] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.ClassReader.readCode(ClassReader.java:2427)
2019-09-09 15:03:13,134 [7404476] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1276)
2019-09-09 15:03:13,134 [7404476] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:680)
2019-09-09 15:03:13,134 [7404476] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:392)
在其中看不到任何可疑的东西,除了:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".