Package org.jboss.aop.reflectprototype

Examples of org.jboss.aop.reflectprototype.JavassistAopTypeInfoFactoryImpl


      {
         CtClass pojo = pool.get("org.jboss.test.aop.reflectprototype.POJO");
        
         assertFalse("POJO shouldnt be frozen", pojo.isFrozen());
        
         JavassistAopTypeInfoFactoryImpl typeInfoFactory = new JavassistAopTypeInfoFactoryImpl();
         ClassInfo pojoTypeInfo = (JavassistTypeInfo) typeInfoFactory.get(pojo);
        
         MethodInfo[] methodInfos = pojoTypeInfo.getDeclaredMethods();
         assertEquals("It should be one method in POJO", methodInfos.length, 1);
        
//         CtClass pojo2 = pool.get("org.jboss.test.aop.reflectprototype.POJO");
         try
         {
            CtMethod bar = CtNewMethod.make("public void bar() {}", pojo);
            pojo.addMethod(bar);
         }
         catch (CannotCompileException e)
         {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }
        
         ClassInfo pojoTypeInfo2 = (JavassistTypeInfo) typeInfoFactory.get(pojo);
         assertEquals("It should be two methods in POJO", pojoTypeInfo2.getDeclaredMethods().length, 2);
        
         assertFalse("POJO shouldnt be frozen", pojo.isFrozen());
        
      }
View Full Code Here

TOP

Related Classes of org.jboss.aop.reflectprototype.JavassistAopTypeInfoFactoryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.