"No junit.jar" 在 IDEA 2021.3.3 社区版中测试 运行 时出现异常
"No junit.jar" exception while running tests in IDEA 2021.3.3 Community Edition
我正在尝试 运行 Kotlin 项目在 IDEA 2021.3.3 Community Edition (debian Linux) 中的测试,请观看视频 https://ibb.co/cb8jhfW
我在控制台中收到错误“No junit.jar”和以下堆栈跟踪:
com.intellij.execution.junit.JUnitUtil$NoJUnitException: No junit.jar
at com.intellij.execution.junit.JUnitUtil.checkTestCase(JUnitUtil.java:393)
at com.intellij.execution.junit.TestPackage.createJavaParameters(TestPackage.java:230)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:865)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:44)
at com.intellij.execution.impl.DefaultJavaProgramRunner.patchJavaCommandLineParams(DefaultJavaProgramRunner.java:137)
at com.intellij.execution.impl.DefaultJavaProgramRunner.lambda$doExecuteAsync(DefaultJavaProgramRunner.java:163)
at com.intellij.execution.target.TargetEnvironmentAwareRunProfileState.run(TargetEnvironmentAwareRunProfileState.java:58)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync(CoreProgressManager.java:496)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:832)
同时来自同一项目的子模块的一些测试运行很好(例如模块integration_test),你能告诉我发生了什么吗?
UPD我把我的问题录下来了,请看一下https://ibb.co/LS95PCN
似乎父模块本身没有测试,也没有附加的 junit。您可以更改 运行 配置以搜索 'in whole project'(根据视频,您有 'In single module'),然后 IDEA 应该会找到所有测试。
我正在尝试 运行 Kotlin 项目在 IDEA 2021.3.3 Community Edition (debian Linux) 中的测试,请观看视频 https://ibb.co/cb8jhfW 我在控制台中收到错误“No junit.jar”和以下堆栈跟踪:
com.intellij.execution.junit.JUnitUtil$NoJUnitException: No junit.jar
at com.intellij.execution.junit.JUnitUtil.checkTestCase(JUnitUtil.java:393)
at com.intellij.execution.junit.TestPackage.createJavaParameters(TestPackage.java:230)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:865)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:44)
at com.intellij.execution.impl.DefaultJavaProgramRunner.patchJavaCommandLineParams(DefaultJavaProgramRunner.java:137)
at com.intellij.execution.impl.DefaultJavaProgramRunner.lambda$doExecuteAsync(DefaultJavaProgramRunner.java:163)
at com.intellij.execution.target.TargetEnvironmentAwareRunProfileState.run(TargetEnvironmentAwareRunProfileState.java:58)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync(CoreProgressManager.java:496)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:832)
同时来自同一项目的子模块的一些测试运行很好(例如模块integration_test),你能告诉我发生了什么吗?
UPD我把我的问题录下来了,请看一下https://ibb.co/LS95PCN
似乎父模块本身没有测试,也没有附加的 junit。您可以更改 运行 配置以搜索 'in whole project'(根据视频,您有 'In single module'),然后 IDEA 应该会找到所有测试。