/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.aop.classinfopool;

import org.jboss.aspects.kernel.ClassInfoPool;
import org.jboss.reflect.spi.ClassInfo;
import org.jboss.reflect.spi.MethodInfo;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;

/**
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.1.2.3 $
 */
public class AOPTester extends TestCase
{
   public static void main(String[] args)
   {
      TestRunner.run(suite());
   }

   public static Test suite()
   {
      TestSuite suite = new TestSuite("AOPTester");
      suite.addTestSuite(AOPTester.class);
      return suite;
   }

   public AOPTester(String name)
   {
      super(name);
   }

   // Public -------------------------------------------------------

   public void testClassInfoPool() throws Exception
   {
      ClassInfoPool pool = ClassInfoPool.getPool(Thread.currentThread().getContextClassLoader());
      ClassInfo ci = pool.getClassInfo("java.awt.BorderLayout");
      MethodInfo[] methods = ci.getDeclaredMethods();
      for (int i = 0; i < methods.length; i++)
      {
         System.out.println(methods[i].getName());
      }
   }
}

