Skip to content

Commit 48d9e44

Browse files
committed
Add tests for loading of types in annotations
1 parent 767cbb1 commit 48d9e44

32 files changed

+114
-0
lines changed
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public @interface AnnotationWithArrayValue {
2+
3+
Class<?>[] value();
4+
5+
}
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public @interface AnnotationWithClassValue {
2+
3+
Class<?> value();
4+
5+
}
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@AnnotationWithArrayValue({MyClassA.class, MyClassB.class})
2+
public class ArrayValueAnnotationOnClass {
3+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ArrayValueAnnotationOnField {
2+
@AnnotationWithArrayValue({MyClassA.class, MyClassB.class})
3+
int arrayValueAnnotatedField;
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ArrayValueAnnotationOnMethod {
2+
@AnnotationWithArrayValue({MyClassA.class, MyClassB.class})
3+
public void arrayValueAnnotatedMethod() {}
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ArrayValueAnnotationOnParameter {
2+
public void classValueAnnotatedParameter(
3+
@AnnotationWithArrayValue({MyClassA.class, MyClassB.class}) int param) {}
4+
}
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@AnnotationWithClassValue(MyClassA.class)
2+
public class ClassValueAnnotationOnClass {
3+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ClassValueAnnotationOnField {
2+
@AnnotationWithClassValue(MyClassA.class)
3+
int classValueAnnotatedField;
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ClassValueAnnotationOnMethod {
2+
@AnnotationWithClassValue(MyClassA.class)
3+
public void classValueAnnotatedMethod() {}
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public class ClassValueAnnotationOnParameter {
2+
public void classValueAnnotatedParameter(
3+
@AnnotationWithClassValue(MyClassA.class) int param) {}
4+
}
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public class MyClassA {}
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public class MyClassB {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ArrayValueAnnotationOnClass.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
Getting class `MyClassB' from file \.[\\/]MyClassB\.class
6+
--
7+
--
8+
This test checks that element classes of arrays that are given as values of a class-level annotation
9+
are loaded by java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ArrayValueAnnotationOnField.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
Getting class `MyClassB' from file \.[\\/]MyClassB\.class
6+
--
7+
--
8+
This test checks that element classes of arrays that are given as values of a field-level annotation
9+
are loaded by java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ArrayValueAnnotationOnMethod.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
Getting class `MyClassB' from file \.[\\/]MyClassB\.class
6+
--
7+
--
8+
This test checks that element classes of arrays that are given as values of a method-level
9+
annotation are loaded by java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ArrayValueAnnotationOnParameter.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
Getting class `MyClassB' from file \.[\\/]MyClassB\.class
6+
--
7+
--
8+
This test checks that element classes of arrays that are given as values of an annotation at method
9+
parameter level are loaded by java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ClassValueAnnotationOnClass.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
--
6+
MyClassB
7+
--
8+
This test checks that classes that are given as values of a class-level annotation are loaded by
9+
java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ClassValueAnnotationOnField.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
--
6+
MyClassB
7+
--
8+
This test checks that classes that are given as values of a field-level annotation are loaded by
9+
java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ClassValueAnnotationOnMethod.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
--
6+
MyClassB
7+
--
8+
This test checks that classes that are given as values of a method-level annotation are loaded by
9+
java_class_loadert.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
ClassValueAnnotationOnParameter.class
3+
--verbosity 10
4+
Getting class `MyClassA' from file \.[\\/]MyClassA\.class
5+
--
6+
MyClassB
7+
--
8+
This test checks that classes that are given as values of an annotation at method parameter level
9+
are loaded by java_class_loadert.

0 commit comments

Comments
 (0)