Kapt: Simplify wrapper tests

(cherry picked from commit 1677984)
This commit is contained in:
Yan Zhulanow
2016-09-16 02:00:31 +03:00
committed by Yan Zhulanow
parent e04f834a0e
commit 238340a143
31 changed files with 225 additions and 394 deletions
@@ -1 +0,0 @@
annotation class KotlinAnnotation(val a: String, val b: Int)
@@ -1,13 +1,17 @@
// EnumClass
// FQNAME: EnumClass
// FILE: EnumClass.java
enum EnumClass {
RED, GREEN, BLUE;
void someMethod() {
System.out.println("Hello, world!")
}
String getStringRepresentation() {
return this.toString();
}
}
}
// FILE: Anno.kt
annotation class Anno
@@ -1,5 +1,6 @@
// MetaAnnotation
// FQNAME: MetaAnnotation
// FILE: MetaAnnotation.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -10,4 +11,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface MetaAnnotation {
String strValue();
}
}
// FILE: Anno.kt
annotation class Anno
@@ -1,5 +1,6 @@
// Simple
// FQNAME: Simple
// FILE: Simple.java
@interface Anno {
String[] numbers();
}
@@ -29,4 +30,7 @@ public abstract class Simple {
protected String strMethod(int param) {
return "A";
}
}
}
// FILE: KotlinAnnotation.kt
annotation class KotlinAnnotation(val a: String, val b: Int)
@@ -1,5 +1,6 @@
// WithNested
// FQNAME: WithNested
// FILE: WithNested.java
class WithNested {
void myClassFun() {}
@@ -18,4 +19,7 @@ class WithNested {
interface NestedInterface {
void nestedInterfaceFun() {}
}
}
}
// FILE: Anno.kt
annotation class Anno
@@ -1,21 +1,23 @@
// test.Main
// FQNAME: test.Main
package test
import kotlin.reflect.KClass
@MainAnno("A", 5)
class Main {
@field:XAnno(color = Color.GREEN)
val x: String
val x: String = ""
@get:YAnno(arrayOf<String>("Mary", "Tom"), intArrayOf(1, 3, 5), arrayOf<Color>(Color.GREEN, Color.RED))
val y: String
val y: String = ""
@set:ZAnno(String::class, arrayOf(String::class, Long::class, Main::class))
var z: String
var z: String = ""
// Property annotations are lost here (we don't create Elements (javac API) for the synthetic propertyName$annotations() methods)
@MainAnno("B", 6)
val zz: String
val zz: String = ""
}
enum class Color {
@@ -26,6 +28,6 @@ annotation class MainAnno(val a: String, val b: Int)
annotation class XAnno(val color: Color)
annotation class YAnno(val names: Array<String>, val ints: Array<Int>, val colors: Array<Color>)
annotation class YAnno(val names: Array<String>, val ints: IntArray, val colors: Array<Color>)
annotation class ZAnno(val clazz: Class<*>, val classes = Array<Class<*>>)
annotation class ZAnno(val clazz: KClass<*>, val classes: Array<KClass<*>>)
@@ -1,4 +1,4 @@
// EnumClass
// FQNAME: EnumClass
enum class EnumClass {
RED, GREEN, BLUE;
@@ -1,4 +1,4 @@
// Test
// FQNAME: Test
class Test {
@kotlin.jvm.Transient
@@ -1,7 +1,7 @@
// Anno
// FQNAME: Anno
@Repeatable
@Deprecated
@Deprecated("")
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.EXPRESSION)
annotation class Anno
@@ -1,5 +1,5 @@
@kotlin.annotation.Repeatable
@kotlin.Deprecated
@kotlin.Deprecated(message = "")
@kotlin.annotation.Retention(value = RUNTIME)
@kotlin.annotation.Target(allowedTargets = { CLASS, CONSTRUCTOR, EXPRESSION })
@java.lang.annotation.Retention(value = RUNTIME)
@@ -1,4 +1,4 @@
// MyClass
// FQNAME: MyClass
class MyClass {
companion object {
@@ -1,5 +1,6 @@
// MyClass
// FQNAME: MyClass
@Retention(AnnotationRetention.SOURCE)
@Repeatable
annotation class Anno(val name: String)
@@ -1,10 +1,10 @@
// test.Simple
// FQNAME: test.Simple
package test
abstract class Simple(private val prop: String) {
protected val anotherProp: Int = 5
abstract fun strFun(val x: Long): String
abstract fun strFun(x: Long): String
fun voidFun() {}
}