Simplify "Find Usages" test data, Move configuration options to test files
This commit is contained in:
@@ -436,48 +436,7 @@ public class GenerateTests {
|
||||
"idea/tests/",
|
||||
"JetFindUsagesTest",
|
||||
AbstractJetFindUsagesTest.class,
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findClassUsages/javaClassUsages", "Server.kt", "testFindClassJavaUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findClassUsages/kotlinClassUsages1", "Server.kt", "testFindClassKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findClassUsages/kotlinClassUsages2", "Server.kt", "testFindClassKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findClassUsages/kotlinClassUsages3", "Server.kt", "testFindClassKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findObjectUsages/javaObjectUsages", "Server.kt", "testFindObjectJavaUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findObjectUsages/kotlinObjectUsages", "Server.kt", "testFindObjectKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findMethodUsages/javaMethodUsages", "Server.kt", "testFindMethodJavaUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findMethodUsages/kotlinMethodUsages", "Server.kt", "testFindMethodKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findMethodUsages/javaAndKotlinOverrides", "Server.kt", "testFindMethodJavaUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findMethodUsages/kotlinExtensionAndOverloadUsages", "Server.kt", "testFindMethodKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findPropertyUsages/javaPropertyUsages", "Server.kt", "testFindPropertyJavaUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findPropertyUsages/kotlinPropertyUsages", "Server.kt", "testFindPropertyKotlinUsages"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/findWithFilteringImports", "Server.kt", "testFindWithFilteringImports"
|
||||
),
|
||||
testModelWithFileName(
|
||||
"idea/testData/findUsages/unresolvedAnnotation", "Server.kt", "testFindUsagesUnresolvedAnnotation"
|
||||
)
|
||||
testModelWithPattern("idea/testData/findUsages", "^(.+).0.kt$", "doTest")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -497,8 +456,8 @@ public class GenerateTests {
|
||||
return new SimpleTestClassModel(new File(rootPath), false, Pattern.compile("^(.+)$"), methodName);
|
||||
}
|
||||
|
||||
private static SimpleTestClassModel testModelWithFileName(@NotNull String rootPath, @NotNull String fileName, @NotNull String methodName) {
|
||||
return new SimpleTestClassModel(new File(rootPath), true, Pattern.compile("^(.*)" + fileName + "$"), methodName);
|
||||
private static SimpleTestClassModel testModelWithPattern(@NotNull String rootPath, @NotNull String pattern, @NotNull String methodName) {
|
||||
return new SimpleTestClassModel(new File(rootPath), true, Pattern.compile(pattern), methodName);
|
||||
}
|
||||
|
||||
private static SimpleTestClassModel testModel(
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
package testing
|
||||
|
||||
class <caret>Server() {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package testing;
|
||||
|
||||
class <caret>Server() {
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
package server
|
||||
|
||||
open class <caret>Server {
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
package server
|
||||
|
||||
annotation class <caret>X(val x: String)
|
||||
@@ -0,0 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
package server
|
||||
|
||||
data class <caret>Data
|
||||
@@ -1,3 +0,0 @@
|
||||
package server
|
||||
|
||||
data class <caret>Data
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||
// OPTIONS: overrides
|
||||
open class A<T> {
|
||||
open fun <caret>foo(t: T) {
|
||||
@@ -0,0 +1,2 @@
|
||||
Unclassified usage (29: 18) override fun foo(t: String) {
|
||||
Unclassified usage (3: 17) public void foo(String s) {
|
||||
@@ -1,2 +0,0 @@
|
||||
Unclassified usage (28: 18) override fun foo(t: String) {
|
||||
Unclassified usage (3: 17) public void foo(String s) {
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||
// OPTIONS: usages
|
||||
package testing;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
Function call (10: 7) x.foo(1, 2)
|
||||
Function call (11: 11) a.foo(0, "")
|
||||
Function call (24: 5) foo(t)
|
||||
Function call (29: 7) a.foo(1, "")
|
||||
Function call (34: 9) foo(t)
|
||||
Function call (3: 18) super<A>.foo(t)
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||
// OPTIONS: usages
|
||||
package server;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||
// OPTIONS: overloadUsages
|
||||
trait X<T> {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Function call (11: 11) a.foo(0, "")
|
||||
Function call (11: 7) x.foo(1, 2)
|
||||
Function call (25: 5) foo(t)
|
||||
Function call (30: 7) a.foo(1, "")
|
||||
Function call (35: 9) foo(t)
|
||||
Function call (3: 18) super<A>.foo(t)
|
||||
@@ -0,0 +1,7 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetObjectDeclarationName
|
||||
package server;
|
||||
|
||||
object <caret>O {
|
||||
var foo: String = "foo"
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package server;
|
||||
|
||||
object <caret>O {
|
||||
var foo: String = "foo"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetObjectDeclarationName
|
||||
package server;
|
||||
|
||||
object <caret>O {
|
||||
var foo: String = "foo"
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package server;
|
||||
|
||||
object <caret>O {
|
||||
var foo: String = "foo"
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetProperty
|
||||
package server;
|
||||
|
||||
object O {
|
||||
@@ -0,0 +1,5 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetProperty
|
||||
package server;
|
||||
|
||||
var <caret>foo: String = "foo"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package server;
|
||||
|
||||
var <caret>foo: String = "foo"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
package testing
|
||||
|
||||
public class <caret>Test
|
||||
@@ -0,0 +1,6 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
// FILTERING_RULES: org.jetbrains.jet.plugin.findUsages.JetImportFilteringRule
|
||||
|
||||
package testing
|
||||
|
||||
public class <caret>Test
|
||||
@@ -1,3 +0,0 @@
|
||||
open class <caret>Foo {
|
||||
vv open val foo = 1
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetClass
|
||||
open class <caret>Foo {
|
||||
vv open val foo = 1
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.google.common.base.Function;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.intellij.find.FindManager;
|
||||
import com.intellij.find.findUsages.FindUsagesHandler;
|
||||
@@ -45,52 +44,58 @@ import com.intellij.util.CommonProcessors;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.InTextDirectivesUtils;
|
||||
import org.jetbrains.jet.lang.psi.JetClass;
|
||||
import org.jetbrains.jet.lang.psi.JetFunction;
|
||||
import org.jetbrains.jet.lang.psi.JetObjectDeclarationName;
|
||||
import org.jetbrains.jet.lang.psi.JetProperty;
|
||||
import org.jetbrains.jet.lang.psi.JetNamedFunction;
|
||||
import org.jetbrains.jet.plugin.JetLightProjectDescriptor;
|
||||
import org.jetbrains.jet.plugin.PluginTestCaseBase;
|
||||
import org.jetbrains.jet.plugin.findUsages.JetImportFilteringRule;
|
||||
import org.jetbrains.jet.plugin.findUsages.options.KotlinMethodFindUsagesOptions;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureTestCase {
|
||||
private interface OptionsParser {
|
||||
protected static enum OptionsParser {
|
||||
METHOD {
|
||||
@NotNull
|
||||
@Override
|
||||
public FindUsagesOptions parse(@NotNull String text, @NotNull Project project) {
|
||||
KotlinMethodFindUsagesOptions options = new KotlinMethodFindUsagesOptions(project);
|
||||
options.isUsages = false;
|
||||
for (String s : InTextDirectivesUtils.findListWithPrefixes(text, "// OPTIONS: ")) {
|
||||
if (s.equals("usages")) {
|
||||
options.isUsages = true;
|
||||
}
|
||||
|
||||
if (s.equals("overrides")) {
|
||||
options.isOverridingMethods = true;
|
||||
options.isImplementingMethods = true;
|
||||
}
|
||||
|
||||
if (s.equals("overloadUsages")) {
|
||||
options.isIncludeOverloadUsages = true;
|
||||
options.isUsages = true;
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
FindUsagesOptions parse(@NotNull String text, @NotNull Project project);
|
||||
}
|
||||
public abstract FindUsagesOptions parse(@NotNull String text, @NotNull Project project);
|
||||
|
||||
private static final OptionsParser METHOD_OPTIONS_PARSER = new OptionsParser() {
|
||||
@Override
|
||||
@NotNull
|
||||
public FindUsagesOptions parse(@NotNull String text, @NotNull Project project) {
|
||||
KotlinMethodFindUsagesOptions options = new KotlinMethodFindUsagesOptions(project);
|
||||
options.isUsages = false;
|
||||
for (String s : InTextDirectivesUtils.findListWithPrefixes(text, "// OPTIONS: ")) {
|
||||
if (s.equals("usages")) {
|
||||
options.isUsages = true;
|
||||
}
|
||||
|
||||
if (s.equals("overrides")) {
|
||||
options.isOverridingMethods = true;
|
||||
options.isImplementingMethods = true;
|
||||
}
|
||||
|
||||
if (s.equals("overloadUsages")) {
|
||||
options.isIncludeOverloadUsages = true;
|
||||
options.isUsages = true;
|
||||
}
|
||||
@Nullable
|
||||
public static OptionsParser getParserByPsiElementClass(@NotNull Class<? extends PsiElement> klass) {
|
||||
if (klass == JetNamedFunction.class) {
|
||||
return METHOD;
|
||||
}
|
||||
|
||||
return options;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -104,69 +109,51 @@ public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureT
|
||||
myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/findUsages");
|
||||
}
|
||||
|
||||
public void testFindClassJavaUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, true, JetClass.class, null);
|
||||
}
|
||||
protected <T extends PsiElement> void doTest(@NotNull String path) throws Exception {
|
||||
File mainFile = new File(path);
|
||||
final String mainFileName = mainFile.getName();
|
||||
String mainFileText = FileUtil.loadFile(mainFile);
|
||||
final String prefix = mainFileName.substring(0, mainFileName.indexOf('.') + 1);
|
||||
|
||||
public void testFindClassKotlinUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, false, JetClass.class, null);
|
||||
}
|
||||
List<String> caretElementClassNames = InTextDirectivesUtils.findLinesWithPrefixesRemoved(mainFileText, "// PSI_ELEMENT: ");
|
||||
assert caretElementClassNames.size() == 1;
|
||||
//noinspection unchecked
|
||||
Class<T> caretElementClass = (Class<T>)Class.forName(caretElementClassNames.get(0));
|
||||
|
||||
public void testFindUsagesUnresolvedAnnotation(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, true, JetClass.class, null);
|
||||
}
|
||||
List<String> filteringRuleClassNames = InTextDirectivesUtils.findLinesWithPrefixesRemoved(mainFileText, "// FILTERING_RULES: ");
|
||||
Collection<UsageFilteringRule> filters = new ArrayList<UsageFilteringRule>();
|
||||
for (String filteringRuleClassName : filteringRuleClassNames) {
|
||||
//noinspection unchecked
|
||||
Class<UsageFilteringRule> klass = (Class<UsageFilteringRule>) Class.forName(filteringRuleClassName);
|
||||
filters.add(klass.newInstance());
|
||||
}
|
||||
|
||||
public void testFindMethodJavaUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, true, JetFunction.class, METHOD_OPTIONS_PARSER);
|
||||
}
|
||||
OptionsParser parser = OptionsParser.getParserByPsiElementClass(caretElementClass);
|
||||
|
||||
public void testFindMethodKotlinUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, false, JetFunction.class, METHOD_OPTIONS_PARSER);
|
||||
}
|
||||
|
||||
public void testFindPropertyJavaUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, true, JetProperty.class, null);
|
||||
}
|
||||
|
||||
public void testFindPropertyKotlinUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, false, JetProperty.class, null);
|
||||
}
|
||||
|
||||
public void testFindObjectJavaUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, true, JetObjectDeclarationName.class, null);
|
||||
}
|
||||
|
||||
public void testFindObjectKotlinUsages(@NotNull String path) throws Exception {
|
||||
doTestWithoutFiltering(path, false, JetObjectDeclarationName.class, null);
|
||||
}
|
||||
|
||||
public void testFindWithFilteringImports(@NotNull String path) throws Exception {
|
||||
doTest(path, false, JetClass.class, Lists.newArrayList(new JetImportFilteringRule()), null);
|
||||
}
|
||||
|
||||
private <T extends PsiElement> void doTestWithoutFiltering(
|
||||
@NotNull String path,
|
||||
boolean searchInJava,
|
||||
@NotNull Class<T> caretElementClass,
|
||||
@Nullable OptionsParser parser
|
||||
) throws Exception {
|
||||
doTest(path, searchInJava, caretElementClass, Collections.<UsageFilteringRule>emptyList(), parser);
|
||||
}
|
||||
|
||||
private <T extends PsiElement> void doTest(
|
||||
@NotNull String path,
|
||||
boolean searchInJava,
|
||||
@NotNull Class<T> caretElementClass,
|
||||
@NotNull Collection<? extends UsageFilteringRule> filters,
|
||||
@Nullable OptionsParser parser
|
||||
) throws IOException {
|
||||
String rootPath = path.substring(0, path.lastIndexOf("/") + 1);
|
||||
|
||||
myFixture.configureByFiles(path, rootPath + "Client." + (searchInJava ? "java" : "kt"));
|
||||
File rootDir = new File(rootPath);
|
||||
File[] extraFiles = rootDir.listFiles(
|
||||
new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
if (!name.startsWith(prefix) || name.equals(mainFileName)) return false;
|
||||
|
||||
String ext = name.substring(name.lastIndexOf('.') + 1);
|
||||
return ext.equals("kt") || ext.equals("java");
|
||||
}
|
||||
}
|
||||
);
|
||||
assert extraFiles != null;
|
||||
for (File file : extraFiles) {
|
||||
myFixture.configureByFile(rootPath + file.getName());
|
||||
}
|
||||
myFixture.configureByFile(path);
|
||||
|
||||
T caretElement = PsiTreeUtil.getParentOfType(myFixture.getElementAtCaret(), caretElementClass, false);
|
||||
assertNotNull(String.format("Element with type '%s' wasn't found at caret position", caretElementClass), caretElement);
|
||||
|
||||
FindUsagesOptions options = parser != null ? parser.parse(FileUtil.loadFile(new File(path)), getProject()) : null;
|
||||
FindUsagesOptions options = parser != null ? parser.parse(mainFileText, getProject()) : null;
|
||||
Collection<UsageInfo> usageInfos = findUsages(caretElement, options);
|
||||
|
||||
Collection<UsageInfo2UsageAdapter> filteredUsages = getUsageAdapters(filters, usageInfos);
|
||||
@@ -181,7 +168,7 @@ public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureT
|
||||
};
|
||||
|
||||
Collection<String> finalUsages = Ordering.natural().sortedCopy(Collections2.transform(filteredUsages, convertToString));
|
||||
String expectedText = FileUtil.loadFile(new File(rootPath + "results.txt"), true);
|
||||
String expectedText = FileUtil.loadFile(new File(rootPath + prefix + "results.txt"), true);
|
||||
assertOrderedEquals(finalUsages, Ordering.natural().sortedCopy(StringUtil.split(expectedText, "\n")));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.findUsages;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.InnerTestClasses;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
|
||||
import org.jetbrains.jet.findUsages.AbstractJetFindUsagesTest;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("idea/testData/findUsages")
|
||||
@InnerTestClasses({JetFindUsagesTest.FindClassUsages.class, JetFindUsagesTest.FindMethodUsages.class, JetFindUsagesTest.FindObjectUsages.class, JetFindUsagesTest.FindPropertyUsages.class, JetFindUsagesTest.FindWithFilteringImports.class, JetFindUsagesTest.UnresolvedAnnotation.class})
|
||||
public class JetFindUsagesTest extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindUsages() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/findClassUsages")
|
||||
public static class FindClassUsages extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindClassUsages() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/findClassUsages"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("javaClassUsages.0.kt")
|
||||
public void testJavaClassUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findClassUsages/javaClassUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinClassUsages.0.kt")
|
||||
public void testKotlinClassUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findClassUsages/kotlinClassUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinClassUsages2.0.kt")
|
||||
public void testKotlinClassUsages2() throws Exception {
|
||||
doTest("idea/testData/findUsages/findClassUsages/kotlinClassUsages2.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinClassUsages3.0.kt")
|
||||
public void testKotlinClassUsages3() throws Exception {
|
||||
doTest("idea/testData/findUsages/findClassUsages/kotlinClassUsages3.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/findMethodUsages")
|
||||
public static class FindMethodUsages extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindMethodUsages() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/findMethodUsages"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("javaAndKotlinOverrides.0.kt")
|
||||
public void testJavaAndKotlinOverrides() throws Exception {
|
||||
doTest("idea/testData/findUsages/findMethodUsages/javaAndKotlinOverrides.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("javaMethodUsages.0.kt")
|
||||
public void testJavaMethodUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findMethodUsages/javaMethodUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinMethodUsages.0.kt")
|
||||
public void testKotlinMethodUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findMethodUsages/kotlinMethodUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinOverloadAndExtensionUsages.0.kt")
|
||||
public void testKotlinOverloadAndExtensionUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findMethodUsages/kotlinOverloadAndExtensionUsages.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/findObjectUsages")
|
||||
public static class FindObjectUsages extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindObjectUsages() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/findObjectUsages"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("javaObjectUsages.0.kt")
|
||||
public void testJavaObjectUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findObjectUsages/javaObjectUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinObjectUsages.0.kt")
|
||||
public void testKotlinObjectUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findObjectUsages/kotlinObjectUsages.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/findPropertyUsages")
|
||||
public static class FindPropertyUsages extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindPropertyUsages() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/findPropertyUsages"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("javaPropertyUsages.0.kt")
|
||||
public void testJavaPropertyUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findPropertyUsages/javaPropertyUsages.0.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kotlinPropertyUsages.0.kt")
|
||||
public void testKotlinPropertyUsages() throws Exception {
|
||||
doTest("idea/testData/findUsages/findPropertyUsages/kotlinPropertyUsages.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/findWithFilteringImports")
|
||||
public static class FindWithFilteringImports extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInFindWithFilteringImports() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/findWithFilteringImports"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("findWithFilteringImports.0.kt")
|
||||
public void testFindWithFilteringImports() throws Exception {
|
||||
doTest("idea/testData/findUsages/findWithFilteringImports/findWithFilteringImports.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/findUsages/unresolvedAnnotation")
|
||||
public static class UnresolvedAnnotation extends AbstractJetFindUsagesTest {
|
||||
public void testAllFilesPresentInUnresolvedAnnotation() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/findUsages/unresolvedAnnotation"), Pattern.compile("^(.+).0.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("unresolvedAnnotation.0.kt")
|
||||
public void testUnresolvedAnnotation() throws Exception {
|
||||
doTest("idea/testData/findUsages/unresolvedAnnotation/unresolvedAnnotation.0.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("JetFindUsagesTest");
|
||||
suite.addTestSuite(JetFindUsagesTest.class);
|
||||
suite.addTestSuite(FindClassUsages.class);
|
||||
suite.addTestSuite(FindMethodUsages.class);
|
||||
suite.addTestSuite(FindObjectUsages.class);
|
||||
suite.addTestSuite(FindPropertyUsages.class);
|
||||
suite.addTestSuite(FindWithFilteringImports.class);
|
||||
suite.addTestSuite(UnresolvedAnnotation.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user