Package org.jboss.aop.classpool

Examples of org.jboss.aop.classpool.ClassPoolDomain


      assertEquals(ClassPool.getDefault(), string.getClassPool());
   }
  
   public void testClassInGrandParentOnly() throws Exception
   {
      ClassPoolDomain grandParent = createClassPoolDomain("GRANDPARENT", null, true);
      ClassPool grandParentPool = createDelegatingClassPool(grandParent, JAR_A);
      ClassPoolDomain parent = createClassPoolDomain("PARENT", grandParent, true);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_B);
      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
      accessClassInGrandParentOnly(grandParentPool, parentPool, childPool);
      accessClassInGrandParentOnly(grandParentPool, parentPool, childPool);
View Full Code Here


      }
   }
  
   public void testChildNotInParent() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, true);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_B);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, true);
      ClassPool childPool = createDelegatingClassPool(child, JAR_A);

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

     
   }
  
   public void testChildInParent() 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_A);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessChildInParent(parentPool, childPool);
      accessChildInParent(parentPool, childPool);
View Full Code Here

      assertSame(a1, a2);
   }
  
   public void testChildInParentAndGrandParent() throws Exception
   {
      ClassPoolDomain grandParent = createClassPoolDomain("GRANDPARENT", null, true);
      ClassPool grandParentPool = createDelegatingClassPool(grandParent, JAR_A);
      ClassPoolDomain parent = createClassPoolDomain("PARENT", grandParent, 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
      accessChildInParentAndGrandParent(grandParentPool, parentPool, childPool);
      accessChildInParentAndGrandParent(grandParentPool, parentPool, childPool);
View Full Code Here

      assertSame(a2, a3);
   }

   public void testChildInParentAndGrandParentFromTop() throws Exception
   {
      ClassPoolDomain grandParent = createClassPoolDomain("GRANDPARENT", null, true);
      ClassPool grandParentPool = createDelegatingClassPool(grandParent, JAR_A);
      ClassPoolDomain parent = createClassPoolDomain("PARENT", grandParent, 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
      accessChildInParentAndGrandParentFromTop(grandParentPool, parentPool, childPool);
      accessChildInParentAndGrandParentFromTop(grandParentPool, parentPool, childPool);
View Full Code Here

      assertSame(a2, a3);
   }

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

      assertSame(a2, a3);
   }
  
   public void testGenerateSameNestedClassInChildAndParent() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, false);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", parent, true);
      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(parentClazz, childPool.get(CLASS_A + "$Test"));
   }
  
   public void testNonDelegatingClassPoolAsParent() throws Exception
   {
      ClassPoolDomain root = createNonDelegatingClassPoolDomain(JAR_A);
      ClassPoolDomain child = createClassPoolDomain("CHILD", root, true);
      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 testNoVisibilityBetweenSiblings() throws Exception
   {
      ClassPoolDomain root = createClassPoolDomain("ROOT", null, false);
      ClassPoolDomain domainA = createClassPoolDomain("A", root, false);
      ClassPool poolA = createDelegatingClassPool(domainA, JAR_A);
      ClassPoolDomain domainB = createClassPoolDomain("B", root, false);
      ClassPool poolB = createDelegatingClassPool(domainB, JAR_B);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessNoVisibilityBetweenSiblings(poolA, poolB);
      accessNoVisibilityBetweenSiblings(poolA, poolB);
View Full Code Here

      }
   }
  
   public void testUsesOwnCopy() throws Exception
   {
      ClassPoolDomain root = createClassPoolDomain("ROOT", null, false);
      ClassPoolDomain domainA = createClassPoolDomain("A", root, false);
      ClassPool poolA = createDelegatingClassPool(domainA, JAR_A, JAR_B);
      ClassPoolDomain domainB = createClassPoolDomain("B", root, false);
      ClassPool poolB = createDelegatingClassPool(domainB, JAR_B, JAR_A);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessUsesOwnCopy(poolA, poolB);
      accessUsesOwnCopy(poolA, poolB);
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.