1 22 package org.jboss.test.aop.classinfopool; 23 24 import org.jboss.aspects.kernel.ClassInfoPool; 25 import org.jboss.reflect.spi.ClassInfo; 26 import org.jboss.reflect.spi.MethodInfo; 27 import junit.framework.Test; 28 import junit.framework.TestCase; 29 import junit.framework.TestSuite; 30 import junit.textui.TestRunner; 31 32 36 public class AOPTester extends TestCase 37 { 38 public static void main(String [] args) 39 { 40 TestRunner.run(suite()); 41 } 42 43 public static Test suite() 44 { 45 TestSuite suite = new TestSuite("AOPTester"); 46 suite.addTestSuite(AOPTester.class); 47 return suite; 48 } 49 50 public AOPTester(String name) 51 { 52 super(name); 53 } 54 55 57 public void testClassInfoPool() throws Exception 58 { 59 ClassInfoPool pool = ClassInfoPool.getPool(Thread.currentThread().getContextClassLoader()); 60 ClassInfo ci = pool.getClassInfo("java.awt.BorderLayout"); 61 MethodInfo[] methods = ci.getDeclaredMethods(); 62 for (int i = 0; i < methods.length; i++) 63 { 64 System.out.println(methods[i].getName()); 65 } 66 } 67 } 68 69 | Popular Tags |