[jboss-cvs] JBossAS SVN: r64493 - in projects/aop/trunk/asintegration/src: tests/org/jboss/aop/integration/junit and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 7 22:56:15 EDT 2007


Author: adrian at jboss.org
Date: 2007-08-07 22:56:15 -0400 (Tue, 07 Aug 2007)
New Revision: 64493

Added:
   projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdvice-aop.xml
   projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitively-aop.xml
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/B.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/TestIntercepted.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/c/
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/c/C.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitivelyUnitTestCase.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceUnitTestCase.java
Modified:
   projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersions-aop.xml
   projects/aop/trunk/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimplePrivateUnitTestCase.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentFirstUnitTestCase.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastEnhancedInParentUnitTestCase.java
   projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastUnitTestCase.java
Log:
Remove the hacks and add more tests for classloading

Added: projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdvice-aop.xml
===================================================================
--- projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdvice-aop.xml	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdvice-aop.xml	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop>
+
+   <interceptor class="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>
+
+   <bind pointcut="execution(* org.jboss.test.aop.integration.complex.support.b.TestIntercepted->*(..))">
+      <interceptor-ref name="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>
+   </bind>
+   
+</aop>
\ No newline at end of file

Added: projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitively-aop.xml
===================================================================
--- projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitively-aop.xml	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitively-aop.xml	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop>
+
+   <interceptor class="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>
+
+   <bind pointcut="execution(* org.jboss.test.aop.integration.complex.support.b.TestIntercepted->doSomething(..))">
+      <interceptor-ref name="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>
+   </bind>
+   
+</aop>
\ No newline at end of file

Modified: projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersions-aop.xml
===================================================================
--- projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersions-aop.xml	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/resources/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersions-aop.xml	2007-08-08 02:56:15 UTC (rev 64493)
@@ -2,7 +2,7 @@
 
 <aop>
 
-   <interceptor class="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>
+   <interceptor class="org.jboss.test.aop.integration.complex.support.TestInterceptor" scope="PER_CLASS"/>
 
    <bind pointcut="execution(* org.jboss.test.aop.integration.complex.support.TestIntercepted->*(..))">
       <interceptor-ref name="org.jboss.test.aop.integration.complex.support.TestInterceptor"/>

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/aop/integration/junit/AOPIntegrationTestDelegate.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -60,11 +60,10 @@
    {
       super.setUp();
       
-      system.setTranslator(AspectManager.instance());
+      AspectManager manager = AspectManager.instance();
+      manager.setPushClassLoader(true);
       
-      // FIXME It should not be necessary to set the context classloader here
-      Thread.currentThread().setContextClassLoader(clazz.getClassLoader());
-      
+      system.setTranslator(manager);
       try
       {
          deploy();

Added: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/B.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/B.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/B.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.aop.integration.complex.support.b;
+
+import org.jboss.test.aop.integration.complex.support.TestInterceptor;
+
+/**
+ * B.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class B
+{
+   public B()
+   {
+      TestIntercepted test = new TestIntercepted();
+      if (TestInterceptor.intercepted)
+         throw new RuntimeException("Should not be intercepted yet!");
+      test.doSomething();
+      if (TestInterceptor.intercepted == false)
+         throw new RuntimeException("Not intercepted!");
+   }
+}

Added: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/TestIntercepted.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/TestIntercepted.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/b/TestIntercepted.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.aop.integration.complex.support.b;
+
+import org.jboss.test.aop.integration.complex.support.TestInterceptor;
+
+/**
+ * TestIntercepted.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 43840 $
+ */
+public class TestIntercepted
+{
+   public void doSomething()
+   {
+   }
+   
+   public boolean isIntercepted()
+   {
+      return TestInterceptor.intercepted;
+   }
+}

Added: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/c/C.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/c/C.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/support/c/C.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.aop.integration.complex.support.c;
+
+import org.jboss.test.aop.integration.complex.support.b.TestIntercepted;
+
+/**
+ * C.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class C
+{
+   public C()
+   {
+      try
+      {
+         getClass().getClassLoader().loadClass("org.jboss.test.aop.integration.complex.support.TestInterceptor");
+         throw new RuntimeException("Should not be able to load the advice class from here!");
+      }
+      catch (ClassNotFoundException expected)
+      {
+      }
+      
+      TestIntercepted test = new TestIntercepted();
+      if (test.isIntercepted())
+         throw new RuntimeException("Should not be intercepted yet!");
+      test.doSomething();
+      if (test.isIntercepted() == false)
+         throw new RuntimeException("Not intercepted!");
+   }
+}

Added: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitivelyUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitivelyUnitTestCase.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceTransitivelyUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.aop.integration.complex.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.integration.junit.AOPIntegrationTest;
+import org.jboss.classloader.test.support.MockClassLoaderHelper;
+import org.jboss.classloader.test.support.MockClassLoaderPolicy;
+
+/**
+ * ComplexImportAdviceTransitivelyUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ComplexImportAdviceTransitivelyUnitTestCase extends AOPIntegrationTest
+{
+   private static String PACKAGE_SUPPORT = "org.jboss.test.aop.integration.complex.support";
+   private static String PACKAGE_B = PACKAGE_SUPPORT + ".b";
+   private static String PACKAGE_C = PACKAGE_SUPPORT + ".c";
+   private static String CLASS_C = PACKAGE_C + ".C";
+   
+   public static Test suite()
+   {
+      return suite(ComplexImportAdviceTransitivelyUnitTestCase.class);
+   }
+   
+   public ComplexImportAdviceTransitivelyUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   /*
+    * A complex test that loads classes from its own classloader
+    * but the advice is imported from a different classloader
+    */
+   public void testImportAdvice() throws Exception
+   {
+      MockClassLoaderPolicy supportPolicy = MockClassLoaderHelper.createMockClassLoaderPolicy("Support");
+      supportPolicy.setPathsAndPackageNames(PACKAGE_SUPPORT);
+      ClassLoader support = createClassLoader(supportPolicy);
+      try
+      {
+         MockClassLoaderPolicy bPolicy = MockClassLoaderHelper.createMockClassLoaderPolicy("B");
+         bPolicy.setPathsAndPackageNames(PACKAGE_B);
+         bPolicy.setDelegates(createDelegates(supportPolicy));
+         ClassLoader b = createClassLoader(bPolicy);
+         try
+         {
+            MockClassLoaderPolicy cPolicy = MockClassLoaderHelper.createMockClassLoaderPolicy("C");
+            cPolicy.setPathsAndPackageNames(PACKAGE_C);
+            cPolicy.setDelegates(createDelegates(bPolicy));
+            ClassLoader c = createClassLoader(cPolicy);
+            try
+            {
+               Class<?> classC = c.loadClass(CLASS_C);
+               classC.newInstance();
+            }
+            finally
+            {
+               unregisterClassLoader(c);
+            }
+         }
+         finally
+         {
+            unregisterClassLoader(b);
+         }
+      }
+      finally
+      {
+         unregisterClassLoader(support);
+      }
+   }
+ }

Added: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceUnitTestCase.java	                        (rev 0)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportAdviceUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -0,0 +1,82 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.aop.integration.complex.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.integration.junit.AOPIntegrationTest;
+import org.jboss.classloader.test.support.MockClassLoaderHelper;
+import org.jboss.classloader.test.support.MockClassLoaderPolicy;
+
+/**
+ * ComplexImportAdviceUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ComplexImportAdviceUnitTestCase extends AOPIntegrationTest
+{
+   private static String PACKAGE_SUPPORT = "org.jboss.test.aop.integration.complex.support";
+   private static String PACKAGE_B = PACKAGE_SUPPORT + ".b";
+   private static String CLASS_B = PACKAGE_B + ".B";
+   
+   public static Test suite()
+   {
+      return suite(ComplexImportAdviceUnitTestCase.class);
+   }
+   
+   public ComplexImportAdviceUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   /*
+    * A complex test that loads classes from its own classloader
+    * but the advice is imported from a different classloader
+    */
+   public void testImportAdvice() throws Exception
+   {
+      MockClassLoaderPolicy supportPolicy = MockClassLoaderHelper.createMockClassLoaderPolicy("Support");
+      supportPolicy.setPathsAndPackageNames(PACKAGE_SUPPORT);
+      ClassLoader support = createClassLoader(supportPolicy);
+      try
+      {
+         MockClassLoaderPolicy bPolicy = MockClassLoaderHelper.createMockClassLoaderPolicy("B");
+         bPolicy.setPathsAndPackageNames(PACKAGE_B);
+         bPolicy.setDelegates(createDelegates(supportPolicy));
+         ClassLoader b = createClassLoader(bPolicy);
+         try
+         {
+            Class<?> classB = b.loadClass(CLASS_B);
+            classB.newInstance();
+         }
+         finally
+         {
+            unregisterClassLoader(b);
+         }
+      }
+      finally
+      {
+         unregisterClassLoader(support);
+      }
+   }
+ }

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/complex/test/ComplexImportMultipleVersionsUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -107,69 +107,4 @@
          unregisterClassLoader(support1);
       }
    }
-   
-   // FIXME Remove this test when there is no need for the hack - the hack doesn't work anyway :-)
-   public void testMultiVersionHacked() throws Exception
-   {
-      MockClassLoaderPolicy support1Policy = MockClassLoaderHelper.createMockClassLoaderPolicy("Support1");
-      support1Policy.setPathsAndPackageNames(PACKAGE_SUPPORT);
-      ClassLoader support1 = createClassLoader(support1Policy);
-      try
-      {
-         MockClassLoaderPolicy a1Policy = MockClassLoaderHelper.createMockClassLoaderPolicy("A1");
-         a1Policy.setPathsAndPackageNames(PACKAGE_A);
-         a1Policy.setDelegates(createDelegates(support1Policy));
-         ClassLoader a1 = createClassLoader(a1Policy);
-         try
-         {
-            MockClassLoaderPolicy support2Policy = MockClassLoaderHelper.createMockClassLoaderPolicy("Support2");
-            support2Policy.setPathsAndPackageNames(PACKAGE_SUPPORT);
-            ClassLoader support2 = createClassLoader(support2Policy);
-            try
-            {
-               MockClassLoaderPolicy a2Policy = MockClassLoaderHelper.createMockClassLoaderPolicy("A2");
-               a2Policy.setPathsAndPackageNames(PACKAGE_A);
-               a2Policy.setDelegates(createDelegates(support2Policy));
-               ClassLoader a2 = createClassLoader(a2Policy);
-               try
-               {
-                  try
-                  {
-                     // FIXME This hack should not be necessary
-                     Thread.currentThread().setContextClassLoader(support1);
-                        Class<?> classA1 = a1.loadClass(CLASS_A);
-                        classA1.newInstance();
-
-                     // FIXME This hack does not work
-                     Thread.currentThread().setContextClassLoader(support2);
-
-                     Class<?> classA2 = a2.loadClass(CLASS_A);
-                     assertNotSame(classA2, classA1);
-                     classA2.newInstance();
-                  }
-                  finally
-                  {
-                     Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-                  }
-               }
-               finally
-               {
-                  unregisterClassLoader(a2);
-               }
-            }
-            finally
-            {
-               unregisterClassLoader(support2);
-            }
-         }
-         finally
-         {
-            unregisterClassLoader(a1);
-         }
-      }
-      finally
-      {
-         unregisterClassLoader(support1);
-      }
-   }
-}
+ }

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimplePrivateUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimplePrivateUnitTestCase.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimplePrivateUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -72,31 +72,4 @@
          unregisterClassLoader(classLoader);
       }
    }
-
-   // FIXME Remove this test when the hack is not necessary
-   public void testPrivateHacked() throws Exception
-   {
-      MockClassLoaderPolicy policy = MockClassLoaderHelper.createMockClassLoaderPolicy("A");
-      policy.setPackageNames(PACKAGE_A);
-      policy.setPaths(PACKAGE_A_RESOURCE, PACKAGE_SUPPORT_RESOURCE);
-      ClassLoader classLoader = createClassLoader(policy);
-      try
-      {
-         // FIXME THIS HACK SHOULD NOT BE NECESSARY
-         Thread.currentThread().setContextClassLoader(classLoader);
-         try
-         {
-            Class<?> classA = classLoader.loadClass(CLASS_A);
-            classA.newInstance();
-         }
-         finally
-         {
-            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-         }
-      }
-      finally
-      {
-         unregisterClassLoader(classLoader);
-      }
-   }
 }

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentFirstUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentFirstUnitTestCase.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentFirstUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -73,32 +73,4 @@
          unregisterDomain("Scoped");
       }
    }
-
-   // FIXME Remove this test when the hack is no longer necessary
-   public void testScopedParentFirstHacked() throws Exception
-   {
-      ClassLoaderDomain domain = createScopedClassLoaderDomainParentFirst("Scoped");
-      try
-      {
-         MockClassLoaderPolicy policy = MockClassLoaderHelper.createMockClassLoaderPolicy("A");
-         policy.setPathsAndPackageNames(PACKAGE_A, PACKAGE_SUPPORT);
-         ClassLoader classLoader = createClassLoader(domain, policy);
-
-         // FIXME Remove this HACK
-         Thread.currentThread().setContextClassLoader(classLoader);
-         try
-         {
-            Class<?> classA = classLoader.loadClass(CLASS_A);
-            classA.newInstance();
-         }
-         finally
-         {
-            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-         }
-      }
-      finally
-      {
-         unregisterDomain("Scoped");
-      }
-   }
 }

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastEnhancedInParentUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastEnhancedInParentUnitTestCase.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastEnhancedInParentUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -65,7 +65,6 @@
          policy.setPathsAndPackageNames(PACKAGE_A);
          ClassLoader classLoader = createClassLoader(domain, policy);
 
-         enableTrace("org.jboss.classloader");
          Class<?> classA = classLoader.loadClass(CLASS_A);
          classA.newInstance();
       }

Modified: projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastUnitTestCase.java
===================================================================
--- projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastUnitTestCase.java	2007-08-08 02:55:25 UTC (rev 64492)
+++ projects/aop/trunk/asintegration/src/tests/org/jboss/test/aop/integration/simple/test/SimpleScopedParentLastUnitTestCase.java	2007-08-08 02:56:15 UTC (rev 64493)
@@ -73,32 +73,4 @@
          unregisterDomain("Scoped");
       }
    }
-
-   // FIXME Remove this test when the hack is no longer necessary
-   public void testScopedParentLastHacked() throws Exception
-   {
-      ClassLoaderDomain domain = createScopedClassLoaderDomainParentLast("Scoped");
-      try
-      {
-         MockClassLoaderPolicy policy = MockClassLoaderHelper.createMockClassLoaderPolicy("A");
-         policy.setPathsAndPackageNames(PACKAGE_A, PACKAGE_SUPPORT);
-         ClassLoader classLoader = createClassLoader(domain, policy);
-
-         // FIXME Remove this HACK
-         Thread.currentThread().setContextClassLoader(classLoader);
-         try
-         {
-            Class<?> classA = classLoader.loadClass(CLASS_A);
-            classA.newInstance();
-         }
-         finally
-         {
-            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-         }
-      }
-      finally
-      {
-         unregisterDomain("Scoped");
-      }
-   }
 }




More information about the jboss-cvs-commits mailing list