mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[java] Support go to test for implicit classes
#IDEA-353532 Fixed GitOrigin-RevId: 5692c6d30579b3ca48aa875220a343c1040bbd6b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0232d76e56
commit
a67965fce8
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.testIntergration;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -7,6 +7,7 @@ import com.intellij.openapi.roots.ModuleRootModificationUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.project.IntelliJProjectConfiguration;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.testFramework.IndexingTestUtil;
|
||||
import com.intellij.testFramework.JavaPsiTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
@@ -51,6 +52,15 @@ public class TestFinderHelperTest extends JavaPsiTestCase {
|
||||
assertSameElements(TestFinderHelper.findClassesForTest(t), c);
|
||||
}
|
||||
|
||||
public void testImplicitClass() throws Exception {
|
||||
PsiFile file = createFile("Main.java", "void main() { }");
|
||||
PsiClass c = PsiTreeUtil.getChildOfType(file, PsiImplicitClass.class);
|
||||
PsiClass t = createTest("MainTest");
|
||||
|
||||
assertSameElements(TestFinderHelper.findTestsForClass(c), t);
|
||||
assertSameElements(TestFinderHelper.findClassesForTest(t), c);
|
||||
}
|
||||
|
||||
public void testIgnoreCase() {
|
||||
PsiClass c = createClass("FOo");
|
||||
PsiClass t = createTest("FooTest");
|
||||
|
||||
Reference in New Issue
Block a user