Introduce JavaAgainstKotlinBinariesTest
This commit is contained in:
@@ -75,12 +75,13 @@ public class MockLibraryUtil {
|
|||||||
|
|
||||||
File classesDir = new File(contentDir, "classes");
|
File classesDir = new File(contentDir, "classes");
|
||||||
|
|
||||||
List<File> kotlinFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.kt"), new File(sourcesPath));
|
File srcFile = new File(sourcesPath);
|
||||||
if (!kotlinFiles.isEmpty()) {
|
List<File> kotlinFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.kt"), srcFile);
|
||||||
|
if (srcFile.isFile() || !kotlinFiles.isEmpty()) {
|
||||||
compileKotlin(sourcesPath, classesDir, extraClasspath);
|
compileKotlin(sourcesPath, classesDir, extraClasspath);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<File> javaFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.java"), new File(sourcesPath));
|
List<File> javaFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.java"), srcFile);
|
||||||
if (!javaFiles.isEmpty()) {
|
if (!javaFiles.isEmpty()) {
|
||||||
List<String> classpath = new ArrayList<String>();
|
List<String> classpath = new ArrayList<String>();
|
||||||
classpath.add(ForTestCompileRuntime.runtimeJarForTests().getPath());
|
classpath.add(ForTestCompileRuntime.runtimeJarForTests().getPath());
|
||||||
@@ -170,7 +171,9 @@ public class MockLibraryUtil {
|
|||||||
|
|
||||||
public static void compileKotlin(@NotNull String sourcesPath, @NotNull File outDir, @NotNull String... extraClasspath) {
|
public static void compileKotlin(@NotNull String sourcesPath, @NotNull File outDir, @NotNull String... extraClasspath) {
|
||||||
List<String> classpath = new ArrayList<String>();
|
List<String> classpath = new ArrayList<String>();
|
||||||
classpath.add(sourcesPath);
|
if (new File(sourcesPath).isDirectory()) {
|
||||||
|
classpath.add(sourcesPath);
|
||||||
|
}
|
||||||
Collections.addAll(classpath, extraClasspath);
|
Collections.addAll(classpath, extraClasspath);
|
||||||
|
|
||||||
List<String> args = new ArrayList<String>();
|
List<String> args = new ArrayList<String>();
|
||||||
|
|||||||
@@ -382,7 +382,12 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractJavaAgainstKotlinSourceCheckerTest>() {
|
testClass<AbstractJavaAgainstKotlinSourceCheckerTest>() {
|
||||||
model("kotlinAndJavaChecker")
|
model("kotlinAndJavaChecker/javaAgainstKotlin")
|
||||||
|
model("kotlinAndJavaChecker/javaWithKotlin")
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractJavaAgainstKotlinBinariesCheckerTest>() {
|
||||||
|
model("kotlinAndJavaChecker/javaAgainstKotlin")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractJetPsiUnifierTest>() {
|
testClass<AbstractJetPsiUnifierTest>() {
|
||||||
|
|||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2015 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.kotlin.checkers
|
||||||
|
|
||||||
|
import com.intellij.openapi.roots.ModuleRootModificationUtil
|
||||||
|
import com.intellij.openapi.util.io.FileUtilRt
|
||||||
|
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||||
|
import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||||
|
|
||||||
|
abstract class AbstractJavaAgainstKotlinBinariesCheckerTest : AbstractJavaAgainstKotlinCheckerTest() {
|
||||||
|
override fun setUp() {
|
||||||
|
super.setUp()
|
||||||
|
val testName = getTestName(false)
|
||||||
|
if (testName.startsWith("AllFilesPresentIn")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val libraryName = "libFor" + testName
|
||||||
|
val libraryJar = MockLibraryUtil.compileLibraryToJar(
|
||||||
|
PluginTestCaseBase.getTestDataPathBase() + "/kotlinAndJavaChecker/javaAgainstKotlin/" + getTestName(false) + ".kt",
|
||||||
|
libraryName, false, false
|
||||||
|
)
|
||||||
|
val jarUrl = "jar://" + FileUtilRt.toSystemIndependentName(libraryJar.absolutePath) + "!/"
|
||||||
|
ModuleRootModificationUtil.addModuleLibrary(module, jarUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest(path: String) {
|
||||||
|
doTest(true, true, path.replace(".kt", ".java"))
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-6
@@ -39,7 +39,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class AbstractJavaAgainstKotlinSourceCheckerTest extends KotlinDaemonAnalyzerTestCase {
|
public abstract class AbstractJavaAgainstKotlinCheckerTest extends KotlinDaemonAnalyzerTestCase {
|
||||||
|
|
||||||
private static final LocalInspectionTool[] DEFAULT_TOOLS = new LocalInspectionTool[] {
|
private static final LocalInspectionTool[] DEFAULT_TOOLS = new LocalInspectionTool[] {
|
||||||
new StaticCallOnSubclassInspection(),
|
new StaticCallOnSubclassInspection(),
|
||||||
@@ -62,7 +62,7 @@ public abstract class AbstractJavaAgainstKotlinSourceCheckerTest extends KotlinD
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected String getConfigFileText() {
|
protected String getConfigFileText() {
|
||||||
File configureFile = new File(PluginTestCaseBase.getTestDataPathBase() + "/kotlinAndJavaChecker/" + getTestName(false) + ".txt");
|
File configureFile = new File(PluginTestCaseBase.getTestDataPathBase() + "/kotlinAndJavaChecker/javaAgainstKotlin/" + getTestName(false) + ".txt");
|
||||||
if (!configureFile.exists()) return null;
|
if (!configureFile.exists()) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -109,8 +109,4 @@ public abstract class AbstractJavaAgainstKotlinSourceCheckerTest extends KotlinD
|
|||||||
protected String getTestDataPath() {
|
protected String getTestDataPath() {
|
||||||
return JetTestUtils.getHomeDirectory() + "/";
|
return JetTestUtils.getHomeDirectory() + "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doTest(String path) throws Exception {
|
|
||||||
doTest(true, true, path.replace(".kt", ".java"), path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2015 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.kotlin.checkers
|
||||||
|
|
||||||
|
abstract class AbstractJavaAgainstKotlinSourceCheckerTest : AbstractJavaAgainstKotlinCheckerTest() {
|
||||||
|
fun doTest(path: String) {
|
||||||
|
doTest(true, true, path.replace(".kt", ".java"), path)
|
||||||
|
}
|
||||||
|
}
|
||||||
+109
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2015 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.kotlin.checkers;
|
||||||
|
|
||||||
|
import com.intellij.testFramework.TestDataPath;
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||||
|
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||||
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public class JavaAgainstKotlinBinariesCheckerTestGenerated extends AbstractJavaAgainstKotlinBinariesCheckerTest {
|
||||||
|
public void testAllFilesPresentInJavaAgainstKotlin() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AssignKotlinClassToObjectInJava.kt")
|
||||||
|
public void testAssignKotlinClassToObjectInJava() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/AssignKotlinClassToObjectInJava.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AssignMappedKotlinType.kt")
|
||||||
|
public void testAssignMappedKotlinType() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/AssignMappedKotlinType.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassObjects.kt")
|
||||||
|
public void testClassObjects() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/ClassObjects.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumAutoGeneratedMethods.kt")
|
||||||
|
public void testEnumAutoGeneratedMethods() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumAutoGeneratedMethods.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumEntriesInSwitch.kt")
|
||||||
|
public void testEnumEntriesInSwitch() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumEntriesInSwitch.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumStaticImportInJava.kt")
|
||||||
|
public void testEnumStaticImportInJava() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumStaticImportInJava.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ImplementedMethodsFromTraits.kt")
|
||||||
|
public void testImplementedMethodsFromTraits() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/ImplementedMethodsFromTraits.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JvmOverloadsFunctions.kt")
|
||||||
|
public void testJvmOverloadsFunctions() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/JvmOverloadsFunctions.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("KotlinAnnotations.kt")
|
||||||
|
public void testKotlinAnnotations() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/KotlinAnnotations.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TopLevelFunctionInDataFlowInspection.kt")
|
||||||
|
public void testTopLevelFunctionInDataFlowInspection() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/TopLevelFunctionInDataFlowInspection.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("UseKotlinSubclassesOfMappedTypes.kt")
|
||||||
|
public void testUseKotlinSubclassesOfMappedTypes() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/UseKotlinSubclassesOfMappedTypes.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("UsingKotlinPackageDeclarations.kt")
|
||||||
|
public void testUsingKotlinPackageDeclarations() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/UsingKotlinPackageDeclarations.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
+91
-79
@@ -27,89 +27,101 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("idea/testData/kotlinAndJavaChecker")
|
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class JavaAgainstKotlinSourceCheckerTestGenerated extends AbstractJavaAgainstKotlinSourceCheckerTest {
|
public class JavaAgainstKotlinSourceCheckerTestGenerated extends AbstractJavaAgainstKotlinSourceCheckerTest {
|
||||||
public void testAllFilesPresentInKotlinAndJavaChecker() throws Exception {
|
@TestMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin")
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/kotlinAndJavaChecker"), Pattern.compile("^(.+)\\.kt$"), true);
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class JavaAgainstKotlin extends AbstractJavaAgainstKotlinSourceCheckerTest {
|
||||||
|
public void testAllFilesPresentInJavaAgainstKotlin() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AssignKotlinClassToObjectInJava.kt")
|
||||||
|
public void testAssignKotlinClassToObjectInJava() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/AssignKotlinClassToObjectInJava.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AssignMappedKotlinType.kt")
|
||||||
|
public void testAssignMappedKotlinType() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/AssignMappedKotlinType.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ClassObjects.kt")
|
||||||
|
public void testClassObjects() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/ClassObjects.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumAutoGeneratedMethods.kt")
|
||||||
|
public void testEnumAutoGeneratedMethods() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumAutoGeneratedMethods.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumEntriesInSwitch.kt")
|
||||||
|
public void testEnumEntriesInSwitch() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumEntriesInSwitch.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("EnumStaticImportInJava.kt")
|
||||||
|
public void testEnumStaticImportInJava() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/EnumStaticImportInJava.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ImplementedMethodsFromTraits.kt")
|
||||||
|
public void testImplementedMethodsFromTraits() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/ImplementedMethodsFromTraits.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("JvmOverloadsFunctions.kt")
|
||||||
|
public void testJvmOverloadsFunctions() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/JvmOverloadsFunctions.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("KotlinAnnotations.kt")
|
||||||
|
public void testKotlinAnnotations() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/KotlinAnnotations.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TopLevelFunctionInDataFlowInspection.kt")
|
||||||
|
public void testTopLevelFunctionInDataFlowInspection() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/TopLevelFunctionInDataFlowInspection.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("UseKotlinSubclassesOfMappedTypes.kt")
|
||||||
|
public void testUseKotlinSubclassesOfMappedTypes() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/UseKotlinSubclassesOfMappedTypes.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("UsingKotlinPackageDeclarations.kt")
|
||||||
|
public void testUsingKotlinPackageDeclarations() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/UsingKotlinPackageDeclarations.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("AssignKotlinClassToObjectInJava.kt")
|
@TestMetadata("idea/testData/kotlinAndJavaChecker/javaWithKotlin")
|
||||||
public void testAssignKotlinClassToObjectInJava() throws Exception {
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/AssignKotlinClassToObjectInJava.kt");
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
doTest(fileName);
|
public static class JavaWithKotlin extends AbstractJavaAgainstKotlinSourceCheckerTest {
|
||||||
}
|
public void testAllFilesPresentInJavaWithKotlin() throws Exception {
|
||||||
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/kotlinAndJavaChecker/javaWithKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("AssignMappedKotlinType.kt")
|
@TestMetadata("NoNotNullOnParameterInOverride.kt")
|
||||||
public void testAssignMappedKotlinType() throws Exception {
|
public void testNoNotNullOnParameterInOverride() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/AssignMappedKotlinType.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/javaWithKotlin/NoNotNullOnParameterInOverride.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ClassObjects.kt")
|
|
||||||
public void testClassObjects() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/ClassObjects.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("EnumAutoGeneratedMethods.kt")
|
|
||||||
public void testEnumAutoGeneratedMethods() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/EnumAutoGeneratedMethods.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("EnumEntriesInSwitch.kt")
|
|
||||||
public void testEnumEntriesInSwitch() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/EnumEntriesInSwitch.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("EnumStaticImportInJava.kt")
|
|
||||||
public void testEnumStaticImportInJava() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/EnumStaticImportInJava.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("ImplementedMethodsFromTraits.kt")
|
|
||||||
public void testImplementedMethodsFromTraits() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/ImplementedMethodsFromTraits.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("JvmOverloadsFunctions.kt")
|
|
||||||
public void testJvmOverloadsFunctions() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/JvmOverloadsFunctions.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("KotlinAnnotations.kt")
|
|
||||||
public void testKotlinAnnotations() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/KotlinAnnotations.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("NoNotNullOnParameterInOverride.kt")
|
|
||||||
public void testNoNotNullOnParameterInOverride() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/NoNotNullOnParameterInOverride.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("TopLevelFunctionInDataFlowInspection.kt")
|
|
||||||
public void testTopLevelFunctionInDataFlowInspection() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("UseKotlinSubclassesOfMappedTypes.kt")
|
|
||||||
public void testUseKotlinSubclassesOfMappedTypes() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/UseKotlinSubclassesOfMappedTypes.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("UsingKotlinPackageDeclarations.kt")
|
|
||||||
public void testUsingKotlinPackageDeclarations() throws Exception {
|
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/kotlinAndJavaChecker/UsingKotlinPackageDeclarations.kt");
|
|
||||||
doTest(fileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user