Kapt: add some JeElement tests

(cherry picked from commit 948a4b6)
This commit is contained in:
Yan Zhulanow
2016-08-02 22:47:18 +03:00
committed by Yan Zhulanow
parent 0fc92c784b
commit 927280f7ce
51 changed files with 1154 additions and 14 deletions
@@ -0,0 +1,13 @@
// EnumClass
enum EnumClass {
RED, GREEN, BLUE;
void someMethod() {
System.out.println("Hello, world!")
}
String getStringRepresentation() {
return this.toString();
}
}
@@ -0,0 +1,11 @@
final enum EnumClass {
public static final EnumClass RED
public static final EnumClass GREEN
public static final EnumClass BLUE
void someMethod()
java.lang.String getStringRepresentation()
}
@@ -0,0 +1,13 @@
// MetaAnnotation
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Deprecated
@Target({ ElementType.CONSTRUCTOR, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface MetaAnnotation {
String strValue();
}
@@ -0,0 +1,6 @@
@java.lang.Deprecated
@java.lang.annotation.Target(value = { CONSTRUCTOR, FIELD })
@java.lang.annotation.Retention(value = RUNTIME)
public abstract @interface MetaAnnotation {
public abstract java.lang.String strValue()
}
@@ -0,0 +1,20 @@
// Simple
@KotlinAnnotation(a = "A", b = 5)
public abstract class Simple {
final String field = "A";
abstract void voidMethod();
static {
System.out.println("A");
}
{
System.out.println("b");
}
protected String strMethod(int param) {
return "A";
}
}
@@ -0,0 +1,12 @@
@KotlinAnnotation(a = "A", b = 5)
public abstract class Simple {
static {}
{}
final java.lang.String field
abstract void voidMethod()
protected java.lang.String strMethod(int param)
}
@@ -0,0 +1,21 @@
// WithNested
class WithNested {
void myClassFun() {}
static class NestedClass {
void nestedClassFun() {}
}
class InnerClass {
void innerClassFun() {}
class InnerInnerClass {
void innerInnerClassFun() {}
}
}
interface NestedInterface {
void nestedInterfaceFun() {}
}
}
@@ -0,0 +1,19 @@
class WithNested {
void myClassFun()
static class NestedClass {
void nestedClassFun()
}
class InnerClass {
void innerClassFun()
class InnerInnerClass {
void innerInnerClassFun()
}
}
static abstract interface NestedInterface {
public abstract void nestedInterfaceFun()
}
}
@@ -0,0 +1 @@
annotation class KotlinAnnotation(val a: String, val b: Int)