Kapt: add some JeElement tests
(cherry picked from commit 948a4b6)
This commit is contained in:
committed by
Yan Zhulanow
parent
0fc92c784b
commit
927280f7ce
@@ -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()
|
||||
}
|
||||
+13
@@ -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();
|
||||
}
|
||||
+6
@@ -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)
|
||||
}
|
||||
+21
@@ -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() {}
|
||||
}
|
||||
}
|
||||
+19
@@ -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)
|
||||
Reference in New Issue
Block a user