我有一些項目的單元測試,我在intellij想法中執行。如果我使用java 7,測試工作正常,但是當我將java從7更改爲8時,所有單元測試都會出現此錯誤堆棧跟蹤。JUNIT4在java下無法工作8
java.lang.IllegalArgumentException
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
什麼是這個問題的根本原因?
更新 - 添加測試類和標題的導入。
import junit.framework.TestCase;
import mockit.Expectations;
import mockit.NonStrictExpectations;
import mockit.Mocked;
public class PrepareModule extends TestCase {
看起來問題不在JUNIT它是在intellij – Jens
請添加一些代碼。 – cssGEEK
您是否使用最新版本的IntelliJ? – Tom