1 16 package org.apache.commons.attributes.test; 17 18 import java.lang.reflect.Field ; 19 import java.lang.reflect.Method ; 20 21 import junit.framework.TestCase; 22 23 import org.apache.commons.attributes.Attributes; 24 import org.apache.commons.attributes.InvalidAttributeTargetError; 25 26 public class InnerClassTestCase extends TestCase { 27 28 public void testInnerClassAttributesOnMehtod () throws Exception { 29 Class sample = InnerClassSample.class; 30 Method method = sample.getMethod ("method", new Class []{ InnerClassSample.Internal.class }); 31 assertTrue (Attributes.getAttributes (method, ThreadSafe.class).size () > 0); 32 } 33 34 public void testInnerClassAttributesOnField () throws Exception { 35 Class sample = InnerClassSample.class; 36 Field field = sample.getField ("field"); 37 assertTrue (Attributes.getAttributes (field, ThreadSafe.class).size () > 0); 38 } 39 } | Popular Tags |