Remove leftovers of platformName and platformStatic in test data

Drop unnecessary imports, rename some tests
This commit is contained in:
Alexander Udalov
2016-03-02 16:47:04 +03:00
parent beb11e7ac1
commit 8e77e16bbd
55 changed files with 168 additions and 191 deletions
-2
View File
@@ -1,7 +1,5 @@
// FILE: FakePlatformName.java // FILE: FakePlatformName.java
import kotlin.jvm.JvmName;
public class FakePlatformName { public class FakePlatformName {
@JvmName(name = "fake") @JvmName(name = "fake")
public String foo() { public String foo() {
@@ -1,6 +1,5 @@
// FILE: Test.java // FILE: Test.java
import java.lang.String;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
class Test { class Test {
@@ -31,8 +30,6 @@ class Test {
// FILE: test.kt // FILE: test.kt
import kotlin.jvm.JvmStatic
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class testAnnotation annotation class testAnnotation
@@ -20,8 +20,6 @@ class Test {
// FILE: enumCompanionObject.kt // FILE: enumCompanionObject.kt
import kotlin.jvm.JvmStatic
enum class A { enum class A {
; ;
companion object { companion object {
@@ -22,8 +22,6 @@ class Test {
// FILE: simpleObject.kt // FILE: simpleObject.kt
import kotlin.jvm.JvmStatic
object A { object A {
val b: String = "OK" val b: String = "OK"
@@ -1,13 +1,13 @@
import kotlin.reflect.* import kotlin.reflect.*
import kotlin.reflect.jvm.* import kotlin.reflect.jvm.*
import kotlin.jvm.JvmStatic as static
class A { class A {
private var foo: String = "" private var foo: String = ""
} }
object O { object O {
private @static var bar: String = "" @JvmStatic
private var bar: String = ""
} }
class CounterTest<T>(t: T) { class CounterTest<T>(t: T) {
@@ -1,4 +1,3 @@
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.jvm.isAccessible import kotlin.reflect.jvm.isAccessible
import kotlin.reflect.KCallable import kotlin.reflect.KCallable
import kotlin.reflect.KFunction import kotlin.reflect.KFunction
@@ -11,9 +10,11 @@ class A(private var bar: String = "") {
} }
object O { object O {
private @static var baz: String = "" @JvmStatic
private var baz: String = ""
@static fun getBaz() = (O::class.members.single { it.name == "baz" } as KMutableProperty<*>).apply { isAccessible = true } @JvmStatic
fun getBaz() = (O::class.members.single { it.name == "baz" } as KMutableProperty<*>).apply { isAccessible = true }
fun getGetBaz() = O::class.members.single { it.name == "getBaz" } as KFunction<*> fun getGetBaz() = O::class.members.single { it.name == "getBaz" } as KFunction<*>
} }
@@ -1,12 +1,12 @@
import kotlin.jvm.JvmStatic as static
object Obj { object Obj {
@static fun foo() {} @JvmStatic
fun foo() {}
} }
class C { class C {
companion object { companion object {
@static fun bar() {} @JvmStatic
fun bar() {}
} }
} }
@@ -1,9 +1,12 @@
import kotlin.jvm.JvmStatic as static
object Obj { object Obj {
@static fun foo(s: String) {} @JvmStatic
@static fun bar() {} fun foo(s: String) {}
@static fun sly(obj: Obj) {}
@JvmStatic
fun bar() {}
@JvmStatic
fun sly(obj: Obj) {}
operator fun get(name: String) = Obj::class.members.single { it.name == name } operator fun get(name: String) = Obj::class.members.single { it.name == name }
} }
@@ -1,8 +1,8 @@
import kotlin.jvm.JvmStatic as static
import kotlin.test.assertEquals import kotlin.test.assertEquals
object Obj { object Obj {
@static fun foo(a: String, b: String = "b") = a + b @JvmStatic
fun foo(a: String, b: String = "b") = a + b
} }
fun box(): String { fun box(): String {
@@ -1,11 +1,11 @@
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.KFunction import kotlin.reflect.KFunction
import kotlin.reflect.jvm.* import kotlin.reflect.jvm.*
import kotlin.test.* import kotlin.test.*
class C { class C {
companion object { companion object {
@static fun foo(s: String): Int = s.length @JvmStatic
fun foo(s: String): Int = s.length
} }
} }
@@ -1,10 +1,10 @@
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.KFunction import kotlin.reflect.KFunction
import kotlin.reflect.jvm.* import kotlin.reflect.jvm.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
object O { object O {
@static fun foo(s: String): Int = s.length @JvmStatic
fun foo(s: String): Int = s.length
} }
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.jvm.javaType import kotlin.reflect.jvm.javaType
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -7,7 +6,8 @@ class A {
} }
object O { object O {
@static fun bar(a: A): String = "" @JvmStatic
fun bar(a: A): String = ""
} }
fun box(): String { fun box(): String {
@@ -1,7 +1,6 @@
// FULL_JDK // FULL_JDK
import java.lang.reflect.ParameterizedType import java.lang.reflect.ParameterizedType
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.* import kotlin.reflect.*
import kotlin.reflect.jvm.javaType import kotlin.reflect.jvm.javaType
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -9,7 +8,8 @@ import kotlin.test.assertEquals
class A(private var foo: List<String>) class A(private var foo: List<String>)
object O { object O {
private @static var bar: List<String> = listOf() @JvmStatic
private var bar: List<String> = listOf()
} }
fun topLevel(): List<String> = listOf() fun topLevel(): List<String> = listOf()
@@ -1,4 +1,3 @@
import kotlin.jvm.JvmStatic as static
import kotlin.reflect.KMutableProperty import kotlin.reflect.KMutableProperty
import kotlin.reflect.jvm.javaType import kotlin.reflect.jvm.javaType
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -6,7 +5,8 @@ import kotlin.test.assertEquals
class A(private var foo: String) class A(private var foo: String)
object O { object O {
private @static var bar: String = "" @JvmStatic
private var bar: String = ""
} }
fun box(): String { fun box(): String {
@@ -1,9 +1,9 @@
import kotlin.reflect.* import kotlin.reflect.*
import kotlin.reflect.jvm.* import kotlin.reflect.jvm.*
import kotlin.jvm.JvmStatic as static
object Obj { object Obj {
private @static var result: String = "Fail" @JvmStatic
private var result: String = "Fail"
} }
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
import kotlin.jvm.JvmStatic
class A { class A {
<!WRONG_ANNOTATION_TARGET!>@JvmStatic<!> constructor() {} <!WRONG_ANNOTATION_TARGET!>@JvmStatic<!> constructor() {}
inner class B { inner class B {
@@ -1,6 +1,4 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.jvm.JvmStatic
abstract class A { abstract class A {
open fun a() {} open fun a() {}
@@ -1,6 +1,4 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.jvm.JvmStatic
class A { class A {
companion object { companion object {
@JvmStatic fun a1() { @JvmStatic fun a1() {
@@ -1,6 +1,4 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.jvm.JvmStatic
fun main(args: Array<String>) { fun main(args: Array<String>) {
<!JVM_STATIC_NOT_IN_OBJECT!>@JvmStatic fun a()<!>{ <!JVM_STATIC_NOT_IN_OBJECT!>@JvmStatic fun a()<!>{
@@ -1,6 +1,4 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_VARIABLE
import kotlin.jvm.JvmStatic
open class B { open class B {
public open val base1 : Int = 1 public open val base1 : Int = 1
public open val base2 : Int = 1 public open val base2 : Int = 1
@@ -1,5 +1,3 @@
import kotlin.jvm.JvmStatic
open class Base { open class Base {
fun foo() {} fun foo() {}
} }
@@ -1,6 +1,4 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.jvm.JvmStatic
open class Base { open class Base {
fun `foo$default`(i: Int, mask: Int, mh: Any) {} fun `foo$default`(i: Int, mask: Int, mh: Any) {}
} }
@@ -508,6 +508,57 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
} }
} }
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmStatic extends AbstractDiagnosticsTestWithStdLib {
public void testAllFilesPresentInJvmStatic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("constOrJvmFieldProperty.kt")
public void testConstOrJvmFieldProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constOrJvmFieldProperty.kt");
doTest(fileName);
}
@TestMetadata("constructorProperty.kt")
public void testConstructorProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty.kt");
doTest(fileName);
}
@TestMetadata("constructors.kt")
public void testConstructors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructors.kt");
doTest(fileName);
}
@TestMetadata("finalAndAbstract.kt")
public void testFinalAndAbstract() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/finalAndAbstract.kt");
doTest(fileName);
}
@TestMetadata("functions.kt")
public void testFunctions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/functions.kt");
doTest(fileName);
}
@TestMetadata("localFun.kt")
public void testLocalFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun.kt");
doTest(fileName);
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass") @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
@@ -559,57 +610,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
} }
} }
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformStatic extends AbstractDiagnosticsTestWithStdLib {
public void testAllFilesPresentInPlatformStatic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("constOrJvmFieldProperty.kt")
public void testConstOrJvmFieldProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constOrJvmFieldProperty.kt");
doTest(fileName);
}
@TestMetadata("constructorProperty.kt")
public void testConstructorProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructorProperty.kt");
doTest(fileName);
}
@TestMetadata("constructors.kt")
public void testConstructors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt");
doTest(fileName);
}
@TestMetadata("finalAndAbstract.kt")
public void testFinalAndAbstract() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/finalAndAbstract.kt");
doTest(fileName);
}
@TestMetadata("functions.kt")
public void testFunctions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/functions.kt");
doTest(fileName);
}
@TestMetadata("localFun.kt")
public void testLocalFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/localFun.kt");
doTest(fileName);
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument") @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
@@ -691,33 +691,33 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName); doTest(fileName);
} }
@TestMetadata("jvmNames.kt")
public void testJvmNames() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.kt");
doTest(fileName);
}
@TestMetadata("jvmNamesDuplicate.kt")
public void testJvmNamesDuplicate() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNamesDuplicate.kt");
doTest(fileName);
}
@TestMetadata("jvmOverloads.kt") @TestMetadata("jvmOverloads.kt")
public void testJvmOverloads() throws Exception { public void testJvmOverloads() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt");
doTest(fileName); doTest(fileName);
} }
@TestMetadata("platformNames.kt") @TestMetadata("jvmStaticInClassObject.kt")
public void testPlatformNames() throws Exception { public void testJvmStaticInClassObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNames.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmStaticInClassObject.kt");
doTest(fileName); doTest(fileName);
} }
@TestMetadata("platformNamesDuplicate.kt") @TestMetadata("jvmStaticInObject.kt")
public void testPlatformNamesDuplicate() throws Exception { public void testJvmStaticInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNamesDuplicate.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmStaticInObject.kt");
doTest(fileName);
}
@TestMetadata("platformStaticInClassObject.kt")
public void testPlatformStaticInClassObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInClassObject.kt");
doTest(fileName);
}
@TestMetadata("platformStaticInObject.kt")
public void testPlatformStaticInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInObject.kt");
doTest(fileName); doTest(fileName);
} }
@@ -3324,6 +3324,18 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("jvmStatic.kt")
public void testJvmStatic() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/jvmStatic.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("jvmStaticInObjectIncorrectReceiver.kt")
public void testJvmStaticInObjectIncorrectReceiver() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/jvmStaticInObjectIncorrectReceiver.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("localClassMember.kt") @TestMetadata("localClassMember.kt")
public void testLocalClassMember() throws Exception { public void testLocalClassMember() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/localClassMember.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/localClassMember.kt");
@@ -3336,18 +3348,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("platformStatic.kt")
public void testPlatformStatic() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/platformStatic.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("platformStaticInObjectIncorrectReceiver.kt")
public void testPlatformStaticInObjectIncorrectReceiver() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/platformStaticInObjectIncorrectReceiver.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("privateProperty.kt") @TestMetadata("privateProperty.kt")
public void testPrivateProperty() throws Exception { public void testPrivateProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/privateProperty.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/privateProperty.kt");
@@ -3405,6 +3405,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("jvmStaticInObject.kt")
public void testJvmStaticInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/jvmStaticInObject.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("manyArgumentsOnlyOneDefault.kt") @TestMetadata("manyArgumentsOnlyOneDefault.kt")
public void testManyArgumentsOnlyOneDefault() throws Exception { public void testManyArgumentsOnlyOneDefault() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/manyArgumentsOnlyOneDefault.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/manyArgumentsOnlyOneDefault.kt");
@@ -3435,12 +3441,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("platformStaticInObject.kt")
public void testPlatformStaticInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/platformStaticInObject.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("primitiveDefaultValues.kt") @TestMetadata("primitiveDefaultValues.kt")
public void testPrimitiveDefaultValues() throws Exception { public void testPrimitiveDefaultValues() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/primitiveDefaultValues.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/callBy/primitiveDefaultValues.kt");
@@ -3981,23 +3981,23 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic") @TestMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/jvmStatic")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public static class PlatformStatic extends AbstractBlackBoxCodegenTest { public static class JvmStatic extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInPlatformStatic() throws Exception { public void testAllFilesPresentInJvmStatic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic"), Pattern.compile("^(.+)\\.kt$"), true); KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/reflection/mapping/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), true);
} }
@TestMetadata("companionObjectFunction.kt") @TestMetadata("companionObjectFunction.kt")
public void testCompanionObjectFunction() throws Exception { public void testCompanionObjectFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic/companionObjectFunction.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/jvmStatic/companionObjectFunction.kt");
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("objectFunction.kt") @TestMetadata("objectFunction.kt")
public void testObjectFunction() throws Exception { public void testObjectFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/platformStatic/objectFunction.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/jvmStatic/objectFunction.kt");
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
} }
@@ -4326,9 +4326,9 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@TestMetadata("privatePlatformStaticVarInObject.kt") @TestMetadata("privateJvmStaticVarInObject.kt")
public void testPrivatePlatformStaticVarInObject() throws Exception { public void testPrivateJvmStaticVarInObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/properties/privatePlatformStaticVarInObject.kt"); String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/properties/privateJvmStaticVarInObject.kt");
doTestWithStdlib(fileName); doTestWithStdlib(fileName);
} }
@@ -137,6 +137,39 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
} }
} }
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmStatic extends AbstractCompileJavaAgainstKotlinTest {
public void testAllFilesPresentInJvmStatic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("simpleCompanionObject.kt")
public void testSimpleCompanionObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObject.kt");
doTest(fileName);
}
@TestMetadata("simpleCompanionObjectProperty.kt")
public void testSimpleCompanionObjectProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleCompanionObjectProperty.kt");
doTest(fileName);
}
@TestMetadata("simpleObject.kt")
public void testSimpleObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObject.kt");
doTest(fileName);
}
@TestMetadata("simpleObjectProperty.kt")
public void testSimpleObjectProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/jvmStatic/simpleObjectProperty.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/method") @TestMetadata("compiler/testData/compileJavaAgainstKotlin/method")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
@@ -425,39 +458,6 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
} }
} }
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/platformStatic")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class PlatformStatic extends AbstractCompileJavaAgainstKotlinTest {
public void testAllFilesPresentInPlatformStatic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileJavaAgainstKotlin/platformStatic"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("simpleClassObject.kt")
public void testSimpleClassObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObject.kt");
doTest(fileName);
}
@TestMetadata("simpleClassObjectProperty.kt")
public void testSimpleClassObjectProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.kt");
doTest(fileName);
}
@TestMetadata("simpleObject.kt")
public void testSimpleObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObject.kt");
doTest(fileName);
}
@TestMetadata("simpleObjectProperty.kt")
public void testSimpleObjectProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/compileJavaAgainstKotlin/property") @TestMetadata("compiler/testData/compileJavaAgainstKotlin/property")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
@@ -1,5 +1,3 @@
import kotlin.jvm.JvmStatic
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">@JvmStatic</error> <error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'class'">@JvmStatic</error>
class A { class A {
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'companion object'">@JvmStatic</error> <error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'companion object'">@JvmStatic</error>
@@ -2,9 +2,6 @@
@file:JvmMultifileClass @file:JvmMultifileClass
package test package test
import kotlin.jvm.JvmName
import kotlin.jvm.JvmMultifileClass
<error descr="[CONFLICTING_JVM_DECLARATIONS] Platform declaration clash: The following declarations have the same JVM signature (getX()I): <error descr="[CONFLICTING_JVM_DECLARATIONS] Platform declaration clash: The following declarations have the same JVM signature (getX()I):
fun <get-x>(): Int fun <get-x>(): Int
fun getX(): Int">val x</error> = 1 fun getX(): Int">val x</error> = 1
@@ -175,6 +175,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
doTest(fileName); doTest(fileName);
} }
@TestMetadata("JvmStaticUsagesRuntime.kt")
public void testJvmStaticUsagesRuntime() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/JvmStaticUsagesRuntime.kt");
doTest(fileName);
}
@TestMetadata("LocalObjects.kt") @TestMetadata("LocalObjects.kt")
public void testLocalObjects() throws Exception { public void testLocalObjects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/LocalObjects.kt"); String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/LocalObjects.kt");
@@ -235,12 +241,6 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
doTest(fileName); doTest(fileName);
} }
@TestMetadata("PlatformStaticUsagesRuntime.kt")
public void testPlatformStaticUsagesRuntime() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/PlatformStaticUsagesRuntime.kt");
doTest(fileName);
}
@TestMetadata("PrimaryConstructors.kt") @TestMetadata("PrimaryConstructors.kt")
public void testPrimaryConstructors() throws Exception { public void testPrimaryConstructors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/PrimaryConstructors.kt"); String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/PrimaryConstructors.kt");