Tests with renamed method, incremental compilation between Kotlin and Java.
This commit is contained in:
@@ -296,7 +296,7 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
@TestMetadata("jps-plugin/testData/incremental/withJava")
|
@TestMetadata("jps-plugin/testData/incremental/withJava")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({WithJava.JavaUsedInKotlin.class, WithJava.KotlinUsedInJava.class})
|
@InnerTestClasses({WithJava.JavaUsedInKotlin.class, WithJava.KotlinUsedInJava.class})
|
||||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class WithJava extends AbstractIncrementalJpsTest {
|
public static class WithJava extends AbstractIncrementalJpsTest {
|
||||||
public void testAllFilesPresentInWithJava() throws Exception {
|
public void testAllFilesPresentInWithJava() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), true);
|
||||||
@@ -305,7 +305,7 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
@TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin")
|
@TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({})
|
@InnerTestClasses({})
|
||||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class JavaUsedInKotlin extends AbstractIncrementalJpsTest {
|
public static class JavaUsedInKotlin extends AbstractIncrementalJpsTest {
|
||||||
public void testAllFilesPresentInJavaUsedInKotlin() throws Exception {
|
public void testAllFilesPresentInJavaUsedInKotlin() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), true);
|
||||||
@@ -335,6 +335,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("methodRenamed")
|
||||||
|
public void testMethodRenamed() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("notChangeSignature")
|
@TestMetadata("notChangeSignature")
|
||||||
public void testNotChangeSignature() throws Exception {
|
public void testNotChangeSignature() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/");
|
||||||
@@ -346,7 +352,7 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
@TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava")
|
@TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({})
|
@InnerTestClasses({})
|
||||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class KotlinUsedInJava extends AbstractIncrementalJpsTest {
|
public static class KotlinUsedInJava extends AbstractIncrementalJpsTest {
|
||||||
public void testAllFilesPresentInKotlinUsedInJava() throws Exception {
|
public void testAllFilesPresentInKotlinUsedInJava() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), true);
|
||||||
@@ -376,13 +382,24 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("funRenamed")
|
||||||
|
public void testFunRenamed() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("notChangeSignature")
|
@TestMetadata("notChangeSignature")
|
||||||
public void testNotChangeSignature() throws Exception {
|
public void testNotChangeSignature() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature/");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@TestMetadata("propertyRenamed")
|
||||||
|
public void testPropertyRenamed() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
public class JavaClass {
|
||||||
|
public void f(String s) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
public class JavaClass {
|
||||||
|
public void g(String s) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/JavaClass.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/JavaClass.java
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/_DefaultPackage$willBeResolvedToOther$*$willBeResolvedToOther$1.class
|
||||||
|
out/production/module/_DefaultPackage$willBeResolvedToOther$*.class
|
||||||
|
out/production/module/_DefaultPackage$willBeUnresolved$*.class
|
||||||
|
out/production/module/_DefaultPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/willBeResolvedToOther.kt
|
||||||
|
src/willBeUnresolved.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Kotlin:ERROR:Unresolved reference: f
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
fun willBeResolvedToOther() {
|
||||||
|
fun JavaClass.f(s: String) {
|
||||||
|
}
|
||||||
|
|
||||||
|
JavaClass().f(":|")
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fun willBeUnresolved() {
|
||||||
|
JavaClass().f(":(")
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class WillBeUnresolved {
|
||||||
|
void main() {
|
||||||
|
test.TestPackage.f(":(");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$fun$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/fun.kt
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/WillBeUnresolved.java
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
java:ERROR:$PROJECT/src/WillBeUnresolved.java:3: cannot find symbol
|
||||||
|
symbol : method f(java.lang.String)
|
||||||
|
location: class test.TestPackage
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun f(s: String) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun g(s: String) {
|
||||||
|
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class WillBeUnresolved {
|
||||||
|
void main() {
|
||||||
|
test.TestPackage.getProp();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$prop$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/prop.kt
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/WillBeUnresolved.java
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
java:ERROR:$PROJECT/src/WillBeUnresolved.java:3: cannot find symbol
|
||||||
|
symbol : method getProp()
|
||||||
|
location: class test.TestPackage
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val prop = ":)"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
val prop1 = ":)"
|
||||||
Reference in New Issue
Block a user