01: package org.vraptor.component;
02:
03: import java.lang.reflect.Field;
04: import junit.framework.TestCase;
05: import org.vraptor.annotations.In;
06:
07: public class FieldAnnotationTest extends TestCase {
08:
09: @SuppressWarnings("unchecked")
10: public void testFieldAnnotation() throws SecurityException,
11: NoSuchFieldException {
12: Field field = Test.class.getDeclaredField("field");
13: In annotation = field.getAnnotation(In.class);
14: FieldAnnotation test = new FieldAnnotation<In>(annotation,
15: field);
16: assertEquals(annotation, test.getAnnotation());
17: assertEquals(field, test.getField());
18: }
19:
20: public class Test {
21: @SuppressWarnings("unused")
22: @In
23: private int field;
24: }
25:
26: }
|