自从启动此项目以来,我一直在使用JUnit,并且一切正常。我有数百个测试,当然,在这里和那里,我都开始了。右键单击根测试文件夹,使用JUnit运行(或调试)。但是从昨天开始,当我这样做时,结果是:
Process finished with exit code 0
无需开始任何测试。文件夹树中的任何文件夹都是相同的。我仍然可以运行一个测试类,但是我确实需要一个选项来启动它们。如果您有任何想法,请将其放在此处。
这是我尝试运行测试时记录的内容:
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - IntelliJ IDEA 11.1.2 Build #IU-117.418
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - JDK: 1.6.0_31
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - VM: Java HotSpot(TM) Client VM
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - Vendor: Sun Microsystems Inc.
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - OS: Windows 7
2012-10-31 15:16:55,693 [2727217] ERROR - ij.psi.impl.source.PsiFileImpl - Last Action: RunClass
2012-10-31 15:16:55,693 [2727217] ERROR - m.intellij.util.ExecutorsQuery - com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType
java.lang.ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType
at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:976)
at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:239)
at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:220)
at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:60)
at com.intellij.psi.stubs.StubIndexImpl.process(StubIndexImpl.java:220)
at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:194)
at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:33)
at com.intellij.psi.impl.java.stubs.index.JavaAnnotationIndex.get(JavaAnnotationIndex.java:47)
at com.intellij.psi.impl.search.AnnotatedElementsSearcher.a(AnnotatedElementsSearcher.java:93)
at com.intellij.psi.impl.search.AnnotatedElementsSearcher.execute(AnnotatedElementsSearcher.java:44)
at com.intellij.psi.impl.search.AnnotatedElementsSearcher.execute(AnnotatedElementsSearcher.java:28)
at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:42)
at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:67)
at com.intellij.util.InstanceofQuery.forEach(InstanceofQuery.java:54)
at com.intellij.execution.ConfigurationUtil.addAnnotatedMethodsAnSubclasses(ConfigurationUtil.java:97)
at com.intellij.execution.ConfigurationUtil.findAllTestClasses(ConfigurationUtil.java:77)
at com.intellij.execution.junit.TestPackage$MySearchForTestsTask.run(TestPackage.java:397)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:469)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:169)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:378)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)
好,我修好了。
在菜单中的文件下,有一个无效的缓存选项。修好了!
我有一个java项目的ant构建文件,项目树如下所示: databaseFidling. -->src(包含生产代码源) -->tests(包含测试代码源) -->bin(包含.class) -->reports(包含junit xml报告) -->build.xml 每当我使用“Java project From Existing Ant Build file”用eclipse导入这个项目时,e
为什么会这样?并不是说我绝对需要一个测试方法,我只是好奇而已。当您生成测试方法时,Visual Studio 2012不会给出警告或错误,即使它将无法运行。..
我刚刚创建了springboot项目,src中有一个名为test的文件夹。它有什么作用? 创建spring启动项目时,该项目的src文件夹中存在test文件夹。在test文件夹中,有一个用@RunWith(SpringRunner.class)@SpringBootTest注释的类。它有什么作用?
以下是输出信息: 线程“main”java.lang.noClassDeffounder:top/example/study/testclass(名称错误:top/example/study/testclass)在java.base/java.lang.classloader.defineclass1(本机方法)在java.base/java.lang.classloader.defineclas
我正在从Eclipse迁移到Intellij理念。当我在Intellij理念中运行测试时,我得到了图像中显示的错误,但在Eclipse中没有。测试在Eclipse中运行良好。请告诉我如何解决这个问题。 这就是我运行测试的方式。我得到的错误是: