Package org.jboss.aop.classpool

Examples of org.jboss.aop.classpool.ClassPoolDomain


      assertEquals(parentPool, a2.getClassPool());
   }

   public void testChildInGrandParent() 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_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


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

      assertEquals(childPool, a3.getClassPool());     
   }
  
   public void testChildInSibling() throws Exception
   {
      ClassPoolDomain parent = createClassPoolDomain("PARENT", null, false);
      ClassPool parentPool = createDelegatingClassPool(parent, JAR_A);
      ClassPoolDomain childA = createClassPoolDomain("CHILDA", parent, false);
      ClassPool childPoolA = createDelegatingClassPool(childA, JAR_A);
      ClassPoolDomain childB = createClassPoolDomain("CHILDB", parent, false);
      ClassPool childPoolB = createDelegatingClassPool(childB, JAR_A);
     
      //The first time we access the pool it will create the classes, second time will use the cache
      accessChildInSibling(parentPool, childPoolA, childPoolB);
      accessChildInSibling(parentPool, childPoolA, childPoolB);
View Full Code Here

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

   public void testClassInParentOnly() 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_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

      assertEquals(parentPool, a2.getClassPool());
   }

   public void testClassInGrandParentOnly() 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
      accessChildInGrandParentOnly(grandParentPool, parentPool, childPool);
      accessChildInGrandParentOnly(grandParentPool, parentPool, childPool);
View Full Code Here

      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

      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

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.