Files
kotlin/compiler/testData/codegen/boxWithJava/reflection/javaClassGetFunctions.kt
Alexander Udalov daab3db062 Add WITH_RUNTIME and WITH_REFLECT directives to box tests
Currently all tests in boxWithStdlib/ run with both runtime and reflection
included; eventually they'll be merged into box/ using these directives
2016-03-03 16:11:21 +03:00

29 lines
692 B
Kotlin
Vendored

// WITH_REFLECT
// FILE: J.java
public class J {
public J() {
}
public void member(String s) {
}
public static void staticMethod(int x) {
}
}
// FILE: K.kt
import kotlin.reflect.*
import kotlin.test.assertEquals
fun box(): String {
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.members.map { it.name }.sorted())
assertEquals(listOf("equals", "hashCode", "member", "staticMethod", "toString"), J::class.functions.map { it.name }.sorted())
assertEquals(listOf("member", "staticMethod"), J::class.declaredFunctions.map { it.name }.sorted())
assertEquals(1, J::class.constructors.size)
return "OK"
}