1 32 package net.sf.retrotranslator.runtime.java.lang.reflect; 33 34 import java.lang.reflect.AccessibleObject ; 35 import java.util.*; 36 import junit.framework.TestCase; 37 import net.sf.retrotranslator.runtime.java.lang.MyStyle; 38 39 42 public class _AccessibleObjectTestCase extends TestCase { 43 44 private Class aClass = getClass(); 45 46 protected void methodWithParameter(String s) { 47 } 49 50 public void test() throws Exception { 51 List<AccessibleObject > objects = new ArrayList<AccessibleObject >(); 52 objects.add(aClass.getConstructors()[0]); 53 objects.add(aClass.getDeclaredFields()[0]); 54 objects.add(aClass.getMethods()[0]); 55 for (AccessibleObject object : objects) { 56 assertFalse(object.isAnnotationPresent(MyStyle.class)); 57 assertNull(object.getAnnotation(MyStyle.class)); 58 assertEquals(0, object.getAnnotations().length); 59 assertEquals(0, object.getDeclaredAnnotations().length); 60 } 61 } 62 63 } | Popular Tags |