Migrate boxWithJava tests to multi-file framework
This commit is contained in:
+32
@@ -1,3 +1,5 @@
|
||||
// FILE: Test.java
|
||||
|
||||
import java.lang.String;
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
@@ -26,3 +28,33 @@ class Test {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class testAnnotation
|
||||
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
val b: String = "OK"
|
||||
|
||||
@JvmStatic @testAnnotation fun test1() = b
|
||||
}
|
||||
}
|
||||
|
||||
object B {
|
||||
val b: String = "OK"
|
||||
|
||||
@JvmStatic @testAnnotation fun test1() = b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (Test.test1() != "OK") return "fail 1"
|
||||
|
||||
if (Test.test2() != "OK") return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class testAnnotation
|
||||
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
val b: String = "OK"
|
||||
|
||||
@JvmStatic @testAnnotation fun test1() = b
|
||||
}
|
||||
}
|
||||
|
||||
object B {
|
||||
val b: String = "OK"
|
||||
|
||||
@JvmStatic @testAnnotation fun test1() = b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (Test.test1() != "OK") return "fail 1"
|
||||
|
||||
if (Test.test2() != "OK") return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
class Test {
|
||||
|
||||
public static String test1() {
|
||||
return A.test1();
|
||||
}
|
||||
|
||||
public static String test2() {
|
||||
return A.test2();
|
||||
}
|
||||
|
||||
public static String test3() {
|
||||
return A.test3("JAVA");
|
||||
}
|
||||
|
||||
public static String test4() {
|
||||
return A.getC();
|
||||
}
|
||||
|
||||
}
|
||||
+24
-2
@@ -1,4 +1,26 @@
|
||||
import kotlin.jvm.JvmStatic
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
|
||||
public static String test1() {
|
||||
return A.test1();
|
||||
}
|
||||
|
||||
public static String test2() {
|
||||
return A.test2();
|
||||
}
|
||||
|
||||
public static String test3() {
|
||||
return A.test3("JAVA");
|
||||
}
|
||||
|
||||
public static String test4() {
|
||||
return A.getC();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: simpleCompanionObject.kt
|
||||
|
||||
class A {
|
||||
|
||||
@@ -25,4 +47,4 @@ fun box(): String {
|
||||
if (Test.test4() != "OK") return "fail 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
+22
@@ -1,3 +1,25 @@
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
public static String foo() {
|
||||
return A.foo;
|
||||
}
|
||||
|
||||
public static String constBar() {
|
||||
return A.constBar;
|
||||
}
|
||||
|
||||
public static String getBar() {
|
||||
return A.getBar();
|
||||
}
|
||||
|
||||
public static String baz() {
|
||||
return A.baz();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: enumCompanionObject.kt
|
||||
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
enum class A {
|
||||
@@ -1,17 +0,0 @@
|
||||
class Test {
|
||||
public static String foo() {
|
||||
return A.foo;
|
||||
}
|
||||
|
||||
public static String constBar() {
|
||||
return A.constBar;
|
||||
}
|
||||
|
||||
public static String getBar() {
|
||||
return A.getBar();
|
||||
}
|
||||
|
||||
public static String baz() {
|
||||
return A.baz();
|
||||
}
|
||||
}
|
||||
+25
-1
@@ -1,3 +1,27 @@
|
||||
// FILE: Test.java
|
||||
|
||||
class Test {
|
||||
|
||||
public static String test1() {
|
||||
return A.test1();
|
||||
}
|
||||
|
||||
public static String test2() {
|
||||
return A.test2();
|
||||
}
|
||||
|
||||
public static String test3() {
|
||||
return A.test3("JAVA");
|
||||
}
|
||||
|
||||
public static String test4() {
|
||||
return A.getC();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: simpleObject.kt
|
||||
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
object A {
|
||||
@@ -23,4 +47,4 @@ fun box(): String {
|
||||
if (Test.test4() != "OK") return "fail 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
class Test {
|
||||
|
||||
public static String test1() {
|
||||
return A.test1();
|
||||
}
|
||||
|
||||
public static String test2() {
|
||||
return A.test2();
|
||||
}
|
||||
|
||||
public static String test3() {
|
||||
return A.test3("JAVA");
|
||||
}
|
||||
|
||||
public static String test4() {
|
||||
return A.getC();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user