Package org.jboss.aop.classpool

Examples of org.jboss.aop.classpool.ClassPoolDomain


      assertEquals(grandParentPool, a3.getClassPool());
   }

   public void testClassInGrandParentOnlyFromTop() throws Exception
   {
      ClassPoolDomain grandParent = createClassPoolDomain("GRANDPARENT", null, false);
      ClassPool grandParentPool = createDelegatingClassPool(grandParent, JAR_A);
      ClassPoolDomain parent = createClassPoolDomain("PARENT", grandParent, false);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_B);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, false);
      ClassPool childPool = createDelegatingClassPool(child, JAR_B);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessChildInGrandParentOnlyFromTop(grandParentPool, parentPool, childPool);
      accessChildInGrandParentOnlyFromTop(grandParentPool, parentPool, childPool);
View Full Code Here


      assertEquals(grandParentPool, a3.getClassPool());
   }
  
   public void testGenerateSameClassInChildAndParent() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, false);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, false);
      ClassPool childPool = createDelegatingClassPool(child, JAR_A);
      CtClass parentClazz = TransformerCommon.makeClass(parentPool, "test.Test");
      assertSame(parentClazz, parentPool.get("test.Test"));
      assertSame(parentPool, parentClazz.getClassPool());
      Class<?> parentClass = parentClazz.toClass();
View Full Code Here

      assertSame(childPool.getClassLoader(), childClass.getClassLoader());
   }

   public void testGenerateSameNestedClassInChildAndParent() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, false);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, false);
      ClassPool childPool = createDelegatingClassPool(child, JAR_A);
      CtClass parentA = parentPool.get(CLASS_A);
      CtClass parentClazz = TransformerCommon.makeNestedClass(parentA, "Test", true);
      assertSame(parentPool, parentClazz.getClassPool());
      Class<?> parentClass = parentClazz.toClass();
View Full Code Here

      assertSame(childPool.getClassLoader(), childAClass.getClassLoader());
   }

   public void testNonDelegatingClassPoolAsParent() throws Exception
   {
      ClassPoolDomain root = createNonDelegatingClassPoolDomain(JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", root, false);
      ClassPool childPoolB = createDelegatingClassPool(child, JAR_B);
     
      CtClass b = childPoolB.get(CLASS_B);
      assertSame(childPoolB, b.getClassPool());
      assertSame(b, childPoolB.get(CLASS_B));
View Full Code Here

      super(name);
   }

   public void testAllClassesOnePool() throws Exception
   {
      ClassPoolDomain domain = createClassPoolDomain("SIMPLE", null, false);
      ClassPool pool = createDelegatingClassPool(domain, JAR_A, JAR_B);

      //The first time we access the pool it will create the classes, second time will use the cache
      accessAllClassesOnePool(pool);
      accessAllClassesOnePool(pool);
View Full Code Here

      assertEquals(ClassPool.getDefault(), string.getClassPool());
   }
  
   public void testOnePoolPerClassLoadedByA() throws Exception
   {
      ClassPoolDomain domain = createClassPoolDomain("SIMPLE", null, false);
      ClassPool poolA = createDelegatingClassPool(domain, JAR_A);
      ClassPool poolB = createDelegatingClassPool(domain, JAR_B);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessOnePoolPerClassLoadedByA(poolA, poolB);
View Full Code Here

      assertEquals(poolB, b.getClassPool());
   }
  
   public void testOnePoolPerClassLoadedByB() throws Exception
   {
      ClassPoolDomain domain = createClassPoolDomain("SIMPLE", null, false);
      ClassPool poolA = createDelegatingClassPool(domain, JAR_A);
      ClassPool poolB = createDelegatingClassPool(domain, JAR_B);

      //The first time we access the pool it will create the classes, second time will use the cache
      accessOnePoolPerClassLoadedByB(poolA, poolB);
View Full Code Here

      assertEquals(poolB, b.getClassPool());
   }
  
   public void testCanLoadArrrayCtClass() throws Exception
   {
      ClassPoolDomain domain = createClassPoolDomain("SIMPLE", null, false);
      ClassPool poolA = createDelegatingClassPool(domain, JAR_A);
      ClassPool poolB = createDelegatingClassPool(domain, JAR_B);
      accessCanLoadCtArray(poolA, poolB);
      accessCanLoadCtArray(poolA, poolB);
   }
View Full Code Here

      return delegate;
   }

   protected static ClassPoolDomain createClassPoolDomain(String name, ClassPoolDomain parent, boolean parentFirst)
   {
      ClassPoolDomain domain = new BaseClassPoolDomain(name, parent, parentFirst);
      return domain;
   }
View Full Code Here

      super(name);
   }

   public void testClassInParentOnly() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, true);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, true);
      ClassPool childPool = createDelegatingClassPool(child, JAR_B);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessClassInParentOnly(parentPool, childPool);
      accessClassInParentOnly(parentPool, childPool);
View Full Code Here

TOP

Related Classes of org.jboss.aop.classpool.ClassPoolDomain

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.