KTIJ-25530 [Analysis API] Add missing test cases for Java statics
Can be done now because KT-58980 is fixed
This commit is contained in:
+12
@@ -100,6 +100,12 @@ public class Fe10IdeNormalAnalysisSourceModuleAnalysisApiImportOptimizerTestGene
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unusedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUnusedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedAliasedFunctionReference.kt")
|
@TestMetadata("usedAliasedFunctionReference.kt")
|
||||||
public void testUsedAliasedFunctionReference() throws Exception {
|
public void testUsedAliasedFunctionReference() throws Exception {
|
||||||
@@ -172,6 +178,12 @@ public class Fe10IdeNormalAnalysisSourceModuleAnalysisApiImportOptimizerTestGene
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("usedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUsedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedTypeAsTypeParameter.kt")
|
@TestMetadata("usedTypeAsTypeParameter.kt")
|
||||||
public void testUsedTypeAsTypeParameter() throws Exception {
|
public void testUsedTypeAsTypeParameter() throws Exception {
|
||||||
|
|||||||
+12
@@ -100,6 +100,12 @@ public class FirIdeNormalAnalysisSourceModuleAnalysisApiImportOptimizerTestGener
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unusedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUnusedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedAliasedFunctionReference.kt")
|
@TestMetadata("usedAliasedFunctionReference.kt")
|
||||||
public void testUsedAliasedFunctionReference() throws Exception {
|
public void testUsedAliasedFunctionReference() throws Exception {
|
||||||
@@ -172,6 +178,12 @@ public class FirIdeNormalAnalysisSourceModuleAnalysisApiImportOptimizerTestGener
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("usedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUsedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedTypeAsTypeParameter.kt")
|
@TestMetadata("usedTypeAsTypeParameter.kt")
|
||||||
public void testUsedTypeAsTypeParameter() throws Exception {
|
public void testUsedTypeAsTypeParameter() throws Exception {
|
||||||
|
|||||||
+12
@@ -100,6 +100,12 @@ public class FirStandaloneNormalAnalysisSourceModuleAnalysisApiImportOptimizerTe
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("unusedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUnusedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/unusedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedAliasedFunctionReference.kt")
|
@TestMetadata("usedAliasedFunctionReference.kt")
|
||||||
public void testUsedAliasedFunctionReference() throws Exception {
|
public void testUsedAliasedFunctionReference() throws Exception {
|
||||||
@@ -172,6 +178,12 @@ public class FirStandaloneNormalAnalysisSourceModuleAnalysisApiImportOptimizerTe
|
|||||||
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedInvokeOperatorImport.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("usedStaticFunctionImportFromJavaChildClass.kt")
|
||||||
|
public void testUsedStaticFunctionImportFromJavaChildClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/importOptimizer/analyseImports/usedStaticFunctionImportFromJavaChildClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("usedTypeAsTypeParameter.kt")
|
@TestMetadata("usedTypeAsTypeParameter.kt")
|
||||||
public void testUsedTypeAsTypeParameter() throws Exception {
|
public void testUsedTypeAsTypeParameter() throws Exception {
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
KotlinChild.nonStaticFieldFromBase
|
||||||
|
dependency.Child.STATIC_CONSTANT_FROM_BASE
|
||||||
|
dependency.Child.staticFunFromBase
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// FILE: main.kt
|
||||||
|
import dependency.Base
|
||||||
|
import dependency.Child
|
||||||
|
import dependency.Child.staticFunFromBase
|
||||||
|
import dependency.Child.STATIC_CONSTANT_FROM_BASE
|
||||||
|
import KotlinChild.nonStaticFieldFromBase
|
||||||
|
|
||||||
|
fun usage() {
|
||||||
|
Child.staticFunFromBase()
|
||||||
|
Child.STATIC_CONSTANT_FROM_BASE
|
||||||
|
KotlinChild.nonStaticFieldFromBase
|
||||||
|
}
|
||||||
|
|
||||||
|
object KotlinChild : Base()
|
||||||
|
|
||||||
|
// FILE: dependency/Base.java
|
||||||
|
package dependency;
|
||||||
|
|
||||||
|
public class Base {
|
||||||
|
public static void staticFunFromBase() {}
|
||||||
|
public static String STATIC_CONSTANT_FROM_BASE = "";
|
||||||
|
|
||||||
|
public String nonStaticFieldFromBase = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: dependency/Child.java
|
||||||
|
package dependency;
|
||||||
|
|
||||||
|
public class Child extends Base {}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// FILE: main.kt
|
||||||
|
import dependency.Base
|
||||||
|
import dependency.Child.staticFunFromBase
|
||||||
|
import dependency.Child.STATIC_CONSTANT_FROM_BASE
|
||||||
|
import KotlinChild.nonStaticFieldFromBase
|
||||||
|
|
||||||
|
fun usage() {
|
||||||
|
staticFunFromBase()
|
||||||
|
STATIC_CONSTANT_FROM_BASE
|
||||||
|
nonStaticFieldFromBase
|
||||||
|
}
|
||||||
|
|
||||||
|
object KotlinChild : Base()
|
||||||
|
|
||||||
|
// FILE: dependency/Base.java
|
||||||
|
package dependency;
|
||||||
|
|
||||||
|
public class Base {
|
||||||
|
public static void staticFunFromBase() {}
|
||||||
|
public static String STATIC_CONSTANT_FROM_BASE = "";
|
||||||
|
|
||||||
|
public String nonStaticFieldFromBase = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: dependency/Child.java
|
||||||
|
package dependency;
|
||||||
|
|
||||||
|
public class Child extends Base {}
|
||||||
Reference in New Issue
Block a user