[jboss-cvs] JBossAS SVN: r82019 - in projects/aop/trunk/asintegration-mc: src/tests/org/jboss/test/aop/classpool/jbosscl/support and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 3 15:47:57 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-12-03 15:47:56 -0500 (Wed, 03 Dec 2008)
New Revision: 82019
Added:
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockDeploymentUnit.java
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockModuleFactory.java
Modified:
projects/aop/trunk/asintegration-mc/.classpath
projects/aop/trunk/asintegration-mc/pom.xml
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/TestMockClassLoaderPolicyModule.java
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/JBossClClassPoolTest.java
Log:
[JBAOP-666] Rewrite test framework to work more similar to what actually happens in AS 5 rather than using the jboss-cl mock framework. For the classpools it is not good enough to delegate to the same classloader in the background since all resources can be loaded from there
Modified: projects/aop/trunk/asintegration-mc/.classpath
===================================================================
--- projects/aop/trunk/asintegration-mc/.classpath 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/.classpath 2008-12-03 20:47:56 UTC (rev 82019)
@@ -1,68 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/etc" including="jbossorg-eula.txt" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/main"/>
- <classpathentry kind="src" path="src/resources/tests" output="target/test-classes" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/tests" output="target/test-classes"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-junit/1.7.0/ant-junit-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/bcel/bcel/5.1/bcel-5.1.jar" sourcepath="M2_REPO/bcel/bcel/5.1/bcel-5.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4-jboss-update1/concurrent-1.3.4-jboss-update1.jar" sourcepath="M2_REPO/oswego-concurrent/concurrent/1.3.4-jboss-update1/concurrent-1.3.4-jboss-update1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/urbanophile/java-getopt/1.0.9/java-getopt-1.0.9.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4-sources.jar"/>
- <classpathentry kind="src" path="/jboss-aop"/>
- <classpathentry kind="src" path="/jboss-aop-asintegration-core"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-aop-mc-int/2.0.0.CR1/jboss-aop-mc-int-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-aop-mc-int/2.0.0.CR1/jboss-aop-mc-int-2.0.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-bootstrap/5.0.0.CR2/jboss-as-bootstrap-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-bootstrap/5.0.0.CR2/jboss-as-bootstrap-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2-tests.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-jmx/5.0.0.CR2/jboss-as-jmx-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-jmx/5.0.0.CR2/jboss-as-jmx-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-main/5.0.0.CR2/jboss-as-main-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-main/5.0.0.CR2/jboss-as-main-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-mbeans/5.0.0.CR2/jboss-as-mbeans-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-mbeans/5.0.0.CR2/jboss-as-mbeans-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-system/5.0.0.CR2/jboss-as-system-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-system/5.0.0.CR2/jboss-as-system-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-system-jmx/5.0.0.CR2/jboss-as-system-jmx-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-system-jmx/5.0.0.CR2/jboss-as-system-jmx-5.0.0.CR2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloader/2.0.1.GA/jboss-classloader-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloader/2.0.1.GA/jboss-classloader-2.0.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading/2.0.1.GA/jboss-classloading-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading/2.0.1.GA/jboss-classloading-2.0.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.0.3.GA/jboss-classloading-spi-5.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.0.3.GA/jboss-classloading-spi-5.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.1.GA/jboss-classloading-vfs-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.1.GA/jboss-classloading-vfs-2.0.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.CR1/jboss-dependency-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.CR1/jboss-dependency-2.0.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-client/2.0.3.GA/jboss-deployers-client-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-client/2.0.3.GA/jboss-deployers-client-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-client-spi/2.0.3.GA/jboss-deployers-client-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-client-spi/2.0.3.GA/jboss-deployers-client-spi-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-core/2.0.3.GA/jboss-deployers-core-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-core/2.0.3.GA/jboss-deployers-core-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-core-spi/2.0.3.GA/jboss-deployers-core-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-core-spi/2.0.3.GA/jboss-deployers-core-spi-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-impl/2.0.3.GA/jboss-deployers-impl-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-impl/2.0.3.GA/jboss-deployers-impl-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-spi/2.0.3.GA/jboss-deployers-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-spi/2.0.3.GA/jboss-deployers-spi-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-structure-spi/2.0.3.GA/jboss-deployers-structure-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-structure-spi/2.0.3.GA/jboss-deployers-structure-spi-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-vfs/2.0.3.GA/jboss-deployers-vfs-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-vfs/2.0.3.GA/jboss-deployers-vfs-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-vfs-spi/2.0.3.GA/jboss-deployers-vfs-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-vfs-spi/2.0.3.GA/jboss-deployers-vfs-spi-2.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.CR1/jboss-kernel-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.CR1/jboss-kernel-2.0.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-managed/2.0.0.GA/jboss-managed-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-managed/2.0.0.GA/jboss-managed-2.0.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/profiler/jvmti/jboss-profiler-jvmti/1.0.0.CR5/jboss-profiler-jvmti-1.0.0.CR5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-server-manager/0.1.1.GA/jboss-server-manager-0.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-server-manager/0.1.1.GA/jboss-server-manager-0.1.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-test/1.0.3.GA/jboss-test-1.0.3.GA.jar" sourcepath="M2_REPO/jboss/jboss-test/1.0.3.GA/jboss-test-1.0.3.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/test/jboss-test/1.1.1.GA/jboss-test-1.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/test/jboss-test/1.1.1.GA/jboss-test-1.1.1.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.0.0.GA/jboss-vfs-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-vfs/2.0.0.GA/jboss-vfs-2.0.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR15/jbossxb-2.0.0.CR15.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR15/jbossxb-2.0.0.CR15-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="src" path="/pluggable-instrumentor"/>
- <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6.1/qdox-1.6.1.jar" sourcepath="M2_REPO/qdox/qdox/1.6.1/qdox-1.6.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry excluding="**/*.java" including="jbossorg-eula.txt" kind="src" path="src/etc"/>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/resources/tests"/>
+ <classpathentry excluding="org/jboss/test/aop/classpool/jbosscl/support/a/|org/jboss/test/aop/classpool/jbosscl/support/b/|org/jboss/test/aop/classpool/jbosscl/support/c/" kind="src" output="target/test-classes" path="src/tests"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-junit/1.7.0/ant-junit-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/bcel/bcel/5.1/bcel-5.1.jar" sourcepath="M2_REPO/bcel/bcel/5.1/bcel-5.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4-jboss-update1/concurrent-1.3.4-jboss-update1.jar" sourcepath="M2_REPO/oswego-concurrent/concurrent/1.3.4-jboss-update1/concurrent-1.3.4-jboss-update1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/urbanophile/java-getopt/1.0.9/java-getopt-1.0.9.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-aop"/>
+ <classpathentry kind="src" path="/jboss-aop-asintegration-core"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-aop-mc-int/2.0.0.CR1/jboss-aop-mc-int-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-aop-mc-int/2.0.0.CR1/jboss-aop-mc-int-2.0.0.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-bootstrap/5.0.0.CR2/jboss-as-bootstrap-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-bootstrap/5.0.0.CR2/jboss-as-bootstrap-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-j2se/5.0.0.CR2/jboss-as-j2se-5.0.0.CR2-tests.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-jmx/5.0.0.CR2/jboss-as-jmx-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-jmx/5.0.0.CR2/jboss-as-jmx-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-main/5.0.0.CR2/jboss-as-main-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-main/5.0.0.CR2/jboss-as-main-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-mbeans/5.0.0.CR2/jboss-as-mbeans-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-mbeans/5.0.0.CR2/jboss-as-mbeans-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-system/5.0.0.CR2/jboss-as-system-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-system/5.0.0.CR2/jboss-as-system-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-as-system-jmx/5.0.0.CR2/jboss-as-system-jmx-5.0.0.CR2.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-as-system-jmx/5.0.0.CR2/jboss-as-system-jmx-5.0.0.CR2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloader/2.0.1.GA/jboss-classloader-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloader/2.0.1.GA/jboss-classloader-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading/2.0.1.GA/jboss-classloading-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading/2.0.1.GA/jboss-classloading-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.0.3.GA/jboss-classloading-spi-5.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/integration/jboss-classloading-spi/5.0.3.GA/jboss-classloading-spi-5.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.1.GA/jboss-classloading-vfs-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/cl/jboss-classloading-vfs/2.0.1.GA/jboss-classloading-vfs-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.CR1/jboss-dependency-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.0.CR1/jboss-dependency-2.0.0.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-client/2.0.3.GA/jboss-deployers-client-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-client/2.0.3.GA/jboss-deployers-client-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-client-spi/2.0.3.GA/jboss-deployers-client-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-client-spi/2.0.3.GA/jboss-deployers-client-spi-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-core/2.0.3.GA/jboss-deployers-core-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-core/2.0.3.GA/jboss-deployers-core-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-core-spi/2.0.3.GA/jboss-deployers-core-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-core-spi/2.0.3.GA/jboss-deployers-core-spi-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-impl/2.0.3.GA/jboss-deployers-impl-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-impl/2.0.3.GA/jboss-deployers-impl-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-spi/2.0.3.GA/jboss-deployers-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-spi/2.0.3.GA/jboss-deployers-spi-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-structure-spi/2.0.3.GA/jboss-deployers-structure-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-structure-spi/2.0.3.GA/jboss-deployers-structure-spi-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-vfs/2.0.3.GA/jboss-deployers-vfs-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-vfs/2.0.3.GA/jboss-deployers-vfs-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/deployers/jboss-deployers-vfs-spi/2.0.3.GA/jboss-deployers-vfs-spi-2.0.3.GA.jar" sourcepath="M2_REPO/org/jboss/deployers/jboss-deployers-vfs-spi/2.0.3.GA/jboss-deployers-vfs-spi-2.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.CR1/jboss-kernel-2.0.0.CR1.jar" sourcepath="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.0.CR1/jboss-kernel-2.0.0.CR1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-log4j/2.0.5.GA/jboss-logging-log4j-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-managed/2.0.0.GA/jboss-managed-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-managed/2.0.0.GA/jboss-managed-2.0.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/man/jboss-metatype/2.0.0.GA/jboss-metatype-2.0.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/profiler/jvmti/jboss-profiler-jvmti/1.0.0.CR5/jboss-profiler-jvmti-1.0.0.CR5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossas/jboss-server-manager/0.1.1.GA/jboss-server-manager-0.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/jbossas/jboss-server-manager/0.1.1.GA/jboss-server-manager-0.1.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-test/1.0.3.GA/jboss-test-1.0.3.GA.jar" sourcepath="M2_REPO/jboss/jboss-test/1.0.3.GA/jboss-test-1.0.3.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/test/jboss-test/1.1.1.GA/jboss-test-1.1.1.GA.jar" sourcepath="M2_REPO/org/jboss/test/jboss-test/1.1.1.GA/jboss-test-1.1.1.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jboss-vfs/2.0.0.GA/jboss-vfs-2.0.0.GA.jar" sourcepath="M2_REPO/org/jboss/jboss-vfs/2.0.0.GA/jboss-vfs-2.0.0.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/jbossxb/2.0.0.CR15/jbossxb-2.0.0.CR15.jar" sourcepath="M2_REPO/org/jboss/jbossxb/2.0.0.CR15/jbossxb-2.0.0.CR15-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="src" path="/pluggable-instrumentor"/>
+ <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.6.1/qdox-1.6.1.jar" sourcepath="M2_REPO/qdox/qdox/1.6.1/qdox-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: projects/aop/trunk/asintegration-mc/pom.xml
===================================================================
--- projects/aop/trunk/asintegration-mc/pom.xml 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/pom.xml 2008-12-03 20:47:56 UTC (rev 82019)
@@ -81,7 +81,6 @@
</systemProperties>
</configuration>
</plugin>
-<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
@@ -167,7 +166,6 @@
</execution>
</executions>
</plugin>
--->
</plugins>
</build>
Added: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockDeploymentUnit.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockDeploymentUnit.java (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockDeploymentUnit.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -0,0 +1,409 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.classpool.jbosscl.support;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.dependency.spi.ErrorHandlingMode;
+import org.jboss.dependency.spi.ScopeInfo;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.structure.spi.DeploymentResourceLoader;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnitVisitor;
+import org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metadata.spi.MutableMetaData;
+import org.jboss.metadata.spi.scope.ScopeKey;
+import org.jboss.util.JBossObject;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+class MockDeploymentUnit implements DeploymentUnit
+{
+ private static final long serialVersionUID = 1L;
+
+ String name;
+
+ Map<String, Object> attachments = new HashMap<String, Object>();
+
+ public MockDeploymentUnit(String name, ClassLoadingMetaData clmd, URL... urls) throws Exception
+ {
+ this.name = name;
+
+ List<VirtualFile> roots = new ArrayList<VirtualFile>();
+ for (URL url : urls)
+ {
+ VirtualFile file = VFS.getRoot(url);
+ roots.add(file);
+ }
+ addAttachment(VFSClassLoaderClassPathDeployer.VFS_CLASS_PATH, roots);
+
+ addAttachment(ControllerContext.class, new MockControllerContext());
+ addAttachment(ClassLoadingMetaData.class, clmd);
+ }
+
+ public DeploymentUnit addComponent(String name)
+ {
+ return null;
+ }
+
+ public void addControllerContextName(Object name)
+ {
+ }
+
+ public void addIDependOn(DependencyItem dependency)
+ {
+ }
+
+ public boolean createClassLoader(ClassLoaderFactory factory) throws DeploymentException
+ {
+ return false;
+ }
+
+ public <T> Set<? extends T> getAllMetaData(Class<T> type)
+ {
+ return null;
+ }
+
+ public List<DeploymentUnit> getChildren()
+ {
+ return null;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return null;
+ }
+
+ public DeploymentUnit getComponent(String name)
+ {
+ return null;
+ }
+
+ public List<DeploymentUnit> getComponents()
+ {
+ return null;
+ }
+
+ public Set<Object> getControllerContextNames()
+ {
+ return null;
+ }
+
+ public DependencyInfo getDependencyInfo()
+ {
+ return null;
+ }
+
+ public MainDeployer getMainDeployer()
+ {
+ return null;
+ }
+
+ public MetaData getMetaData()
+ {
+ return null;
+ }
+
+ public MutableMetaData getMutableMetaData()
+ {
+ return null;
+ }
+
+ public ScopeKey getMutableScope()
+ {
+ return null;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public DeploymentUnit getParent()
+ {
+ return null;
+ }
+
+ public String getRelativePath()
+ {
+ return null;
+ }
+
+ public ClassLoader getResourceClassLoader()
+ {
+ return null;
+ }
+
+ public DeploymentResourceLoader getResourceLoader()
+ {
+ return null;
+ }
+
+ public ScopeKey getScope()
+ {
+ return null;
+ }
+
+ public String getSimpleName()
+ {
+ return null;
+ }
+
+ public DeploymentUnit getTopLevel()
+ {
+ return this;
+ }
+
+ public MutableAttachments getTransientManagedObjects()
+ {
+ return null;
+ }
+
+ public boolean isComponent()
+ {
+ return false;
+ }
+
+ public boolean isTopLevel()
+ {
+ return false;
+ }
+
+ public void removeClassLoader(ClassLoaderFactory factory)
+ {
+ }
+
+ public boolean removeComponent(String name)
+ {
+ return false;
+ }
+
+ public void removeControllerContextName(Object name)
+ {
+ }
+
+ public void removeIDependOn(DependencyItem dependency)
+ {
+ }
+
+ public void setMutableScope(ScopeKey key)
+ {
+ }
+
+ public void setScope(ScopeKey key)
+ {
+ }
+
+ public void visit(DeploymentUnitVisitor visitor) throws DeploymentException
+ {
+ }
+
+ public Object addAttachment(String name, Object attachment)
+ {
+ return attachments.put(name, attachment);
+ }
+
+ public <T> T addAttachment(Class<T> type, T attachment)
+ {
+ return (T)attachments.put(type.getName(), attachment);
+ }
+
+ public <T> T addAttachment(String name, T attachment, Class<T> expectedType)
+ {
+ return (T)attachments.put(name, attachment);
+ }
+
+ public void clear()
+ {
+ }
+
+ public void clearChangeCount()
+ {
+ }
+
+ public int getChangeCount()
+ {
+ return 0;
+ }
+
+ public Object removeAttachment(String name)
+ {
+ return attachments.remove(name);
+ }
+
+ public <T> T removeAttachment(Class<T> type)
+ {
+ return (T)attachments.remove(type.getName());
+ }
+
+ public <T> T removeAttachment(String name, Class<T> expectedType)
+ {
+ return (T)attachments.remove(name);
+ }
+
+ public void setAttachments(Map<String, Object> map)
+ {
+ attachments = map;
+ }
+
+ public Object getAttachment(String name)
+ {
+ return attachments.get(name);
+ }
+
+ public <T> T getAttachment(Class<T> type)
+ {
+ return (T)attachments.get(type.getName());
+ }
+
+ public <T> T getAttachment(String name, Class<T> expectedType)
+ {
+ return (T)attachments.get(name);
+ }
+
+ public Map<String, Object> getAttachments()
+ {
+ return attachments;
+ }
+
+ public boolean hasAttachments()
+ {
+ return attachments.size() > 0;
+ }
+
+ public boolean isAttachmentPresent(String name)
+ {
+ return attachments.keySet().contains(name);
+ }
+
+ public boolean isAttachmentPresent(Class<?> type)
+ {
+ return attachments.keySet().contains(type.getName());
+ }
+
+ public boolean isAttachmentPresent(String name, Class<?> expectedType)
+ {
+ return attachments.keySet().contains(name);
+ }
+
+ private class MockControllerContext extends JBossObject implements ControllerContext
+ {
+ public Set<Object> getAliases()
+ {
+ return null;
+ }
+
+ public Controller getController()
+ {
+ return null;
+ }
+
+ public DependencyInfo getDependencyInfo()
+ {
+ return null;
+ }
+
+ public Throwable getError()
+ {
+ return null;
+ }
+
+ public ErrorHandlingMode getErrorHandlingMode()
+ {
+ return null;
+ }
+
+ public ControllerMode getMode()
+ {
+ return null;
+ }
+
+ public Object getName()
+ {
+ return name;
+ }
+
+ public ControllerState getRequiredState()
+ {
+ return null;
+ }
+
+ public ScopeInfo getScopeInfo()
+ {
+ return null;
+ }
+
+ public ControllerState getState()
+ {
+ return null;
+ }
+
+ public Object getTarget()
+ {
+ return null;
+ }
+
+ public void install(ControllerState fromState, ControllerState toState) throws Throwable
+ {
+ }
+
+ public void setController(Controller controller)
+ {
+ }
+
+ public void setError(Throwable error)
+ {
+ }
+
+ public void setMode(ControllerMode mode)
+ {
+ }
+
+ public void setRequiredState(ControllerState state)
+ {
+ }
+
+ public void setState(ControllerState state)
+ {
+ }
+
+ public void uninstall(ControllerState fromState, ControllerState toState)
+ {
+ }
+ }
+}
\ No newline at end of file
Added: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockModuleFactory.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockModuleFactory.java (rev 0)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/MockModuleFactory.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -0,0 +1,80 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.classpool.jbosscl.support;
+
+import java.net.URL;
+
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.classloading.spi.metadata.ExportAll;
+import org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MockModuleFactory
+{
+ public static ClassLoaderPolicyModule createModule(String name, boolean importAll, URL... urls) throws Exception
+ {
+ return createModule(name, importAll, null, false, urls);
+ }
+
+ public static ClassLoaderPolicyModule createModule(String name, boolean importAll, String domainName, boolean parentFirst, URL... urls) throws Exception
+ {
+ return createModule(name, importAll, domainName, null, false, urls);
+ }
+
+ public static ClassLoaderPolicyModule createModule(String name, boolean importAll, String domainName, String parentDomainName, boolean parentFirst, URL... urls) throws Exception
+ {
+ ClassLoadingMetaData md = new ClassLoadingMetaData();
+ md.setName(name);
+ md.setImportAll(importAll);
+ if (importAll)
+ {
+ md.setExportAll(ExportAll.NON_EMPTY);
+ }
+
+ if (domainName != null)
+ {
+ md.setDomain(domainName);
+ md.setJ2seClassLoadingCompliance(parentFirst);
+ if (parentDomainName != null)
+ {
+ md.setParentDomain(parentDomainName);
+ }
+ else
+ {
+ md.setParentDomain(ClassLoaderSystem.DEFAULT_DOMAIN_NAME);
+ }
+ }
+ else
+ {
+ md.setDomain(ClassLoaderSystem.DEFAULT_DOMAIN_NAME);
+ }
+
+ MockDeploymentUnit du = new MockDeploymentUnit(name, md, urls);
+ return new VFSDeploymentClassLoaderPolicyModule(du);
+ }
+}
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/TestMockClassLoaderPolicyModule.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/TestMockClassLoaderPolicyModule.java 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/support/TestMockClassLoaderPolicyModule.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -68,6 +68,4 @@
return dynamicClassRoot;
}
-
-
}
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -44,15 +44,24 @@
return suite(ClassLoaderWithRepositorySanityTestCase.class);
}
+// public void testNewCreateClassLoader() throws Exception
+// {
+// System.out.println("-------> 2 " + helper);
+// System.out.println("-------> 3 " + JBossClClassPoolTest.helper);
+// ClassLoader cl = createClassLoader("A", true, JAR_A_1);
+// Class<?> clazz = cl.loadClass(CLASS_A);
+// assertSame(cl, clazz.getClassLoader());
+// }
+
public void testGlobalScope() throws Exception
{
ClassLoader clA = null;
ClassLoader clB = null;
try
{
- clA = createClassLoader("A", true, PACKAGE_A);
+ clA = createClassLoader("A", true, JAR_A_1);
assertModule(clA);
- clB = createClassLoader("B", true, PACKAGE_B);
+ clB = createClassLoader("B", true, JAR_B_1);
assertModule(clB);
try
{
@@ -80,7 +89,7 @@
{
unregisterClassLoader(clA);
}
- assertCannotLoadClass(helper.getDomain(), CLASS_A);
+ assertCannotLoadClass(getDefaultDomain(), CLASS_A);
}
public void testChildDomain() throws Exception
@@ -91,16 +100,16 @@
ClassLoader clC = null;
try
{
- clA = createClassLoader("A", true, PACKAGE_A);
+ clA = createClassLoader("A", true, JAR_A_1);
assertModule(clA);
- clB = createClassLoader("B", true, PACKAGE_B);
+ clB = createClassLoader("B", true, JAR_B_2);
assertModule(clB);
- clC = createChildDomainParentFirstClassLoader("C", "CHILD", true, PACKAGE_C);
+ clC = createChildDomainParentFirstClassLoader("C", "CHILD", true, JAR_C_1);
assertModule(clC);
childDomain = getChildDomainForLoader(clC);
assertNotNull(childDomain);
- assertSame(helper.getDomain(), childDomain.getParent());
+ assertSame(getSystem().getDefaultDomain(), childDomain.getParent());
Class<?> aFromA = clA.loadClass(CLASS_A);
assertNotNull(aFromA);
@@ -127,7 +136,7 @@
unregisterClassLoader(clA);
unregisterClassLoader(clB);
unregisterClassLoader(clC);
- unregisterDomain(childDomain.getName());
+ unregisterDomain(childDomain);
}
}
@@ -139,17 +148,17 @@
ClassLoaderDomain domainB = null;
try
{
- clA = createChildDomainParentFirstClassLoader("A", "ChildA", true, PACKAGE_A);
+ clA = createChildDomainParentFirstClassLoader("A", "ChildA", true, JAR_A_1);
assertModule(clA);
- clB = createChildDomainParentLastClassLoader("B", "ChildB", true, PACKAGE_B);
+ clB = createChildDomainParentLastClassLoader("B", "ChildB", true, JAR_B_1);
assertModule(clB);
domainA = getChildDomainForLoader(clA);
assertNotNull(domainA);
- assertSame(helper.getDomain(), domainA.getParent());
+ assertSame(getSystem().getDefaultDomain(), domainA.getParent());
domainB = getChildDomainForLoader(clB);
assertNotNull(domainB);
- assertSame(helper.getDomain(), domainB.getParent());
+ assertSame(getSystem().getDefaultDomain(), domainB.getParent());
assertNotSame(domainA, domainB);
Class<?> clazzA = clA.loadClass(CLASS_A);
@@ -163,8 +172,8 @@
{
unregisterClassLoader(clA);
unregisterClassLoader(clB);
- unregisterDomain(domainA);
- unregisterDomain(domainB);
+ unregisterDomain(getChildDomainForLoader(clA));
+ unregisterDomain(getChildDomainForLoader(clB));
}
}
@@ -174,11 +183,11 @@
ClassLoader clScoped = null;
try
{
- clScoped = createChildDomainParentFirstClassLoader("SCOPED", "SCOPED", true, PACKAGE_B);
+ clScoped = createChildDomainParentFirstClassLoader("SCOPED", "SCOPED", true, JAR_B_1);
assertModule(clScoped);
assertCannotLoadClass(clScoped, CLASS_A);
- clGlobal = createClassLoader("GLOBAL", true, PACKAGE_A);
+ clGlobal = createClassLoader("GLOBAL", true, JAR_A_1);
assertModule(clScoped);
assertModule(clGlobal);
@@ -203,8 +212,8 @@
ClassLoader clScoped = null;
try
{
- clGlobal = createClassLoader("GLOBAL", true, PACKAGE_A);
- clScoped = createChildDomainParentFirstClassLoader("SCOPED", "SCOPED", true, PACKAGE_B);
+ clGlobal = createClassLoader("GLOBAL", true, JAR_A_1);
+ clScoped = createChildDomainParentFirstClassLoader("SCOPED", "SCOPED", true, JAR_B_1);
Class<?> aFromParent = clGlobal.loadClass(CLASS_A);
assertNotNull(aFromParent);
Class<?> aFromChild = clScoped.loadClass(CLASS_A);
@@ -219,164 +228,171 @@
unregisterDomain(getChildDomainForLoader(clScoped));
}
}
+
+ public void testChildOverrideWithNoParentDelegation() throws Exception
+ {
+ ClassLoader clGlobal = null;
+ ClassLoader clScoped = null;
+ try
+ {
+ clGlobal = createClassLoader("GLOBAL", true, JAR_A_1);
+ clScoped = createChildDomainParentLastClassLoader("CHILD", "CHILD", true, JAR_A_1);
+ Class<?> aFromParent = clGlobal.loadClass(CLASS_A);
+ assertNotNull(aFromParent);
+ Class<?> aFromChild = clScoped.loadClass(CLASS_A);
+ assertNotNull(aFromChild);
+ assertNotSame(aFromParent, aFromChild);
+ assertSame(clGlobal, aFromParent.getClassLoader());
+ assertSame(clScoped, aFromChild.getClassLoader());
+ }
+ finally
+ {
+ unregisterClassLoader(clGlobal);
+ unregisterClassLoader(clScoped);
+ unregisterDomain(getChildDomainForLoader(clScoped));
+ }
+ }
+
+ public void testURLChildOfGlobalUcl() throws Exception
+ {
+ ClassLoader clGlobal = null;
+ ClassLoader clChildA = null;
+ ClassLoader clChildB = null;
+ try
+ {
+ clGlobal = createClassLoader("GLOBAL", true, JAR_A_1);
+ clChildA = createChildURLClassLoader(clGlobal, JAR_B_1);
+
+ Class<?> aFromA = clChildA.loadClass(CLASS_A);
+ assertSame(clGlobal, aFromA.getClassLoader());
+ Class<?> bFromA = clChildA.loadClass(CLASS_B);
+ assertSame(clChildA, bFromA.getClassLoader());
+
+ clChildB = createChildURLClassLoader(clGlobal, JAR_A_2);
+ Class<?> aFromB = clChildB.loadClass(CLASS_A);
+ assertSame(clGlobal, aFromB.getClassLoader());
+ }
+ finally
+ {
+ unregisterClassLoader(clGlobal);
+ unregisterClassLoader(clChildA);
+ unregisterClassLoader(clChildB);
+ }
+ }
+
+ public void testUndeploySibling() throws Exception
+ {
+ ClassLoader clA = null;
+ ClassLoader clB = null;
+ try
+ {
+ try
+ {
+ clA = createClassLoader("A", true, JAR_A_1);
+ assertCannotLoadClass(clA, CLASS_B);
+
+ clB = createClassLoader("B", true, JAR_B_1);
+ Class<?> bFromA = clA.loadClass(CLASS_B);
+ assertSame(clB, bFromA.getClassLoader());
+ }
+ finally
+ {
+ unregisterClassLoader(clB);
+ }
+ assertCannotLoadClass(clA, CLASS_B);
+ }
+ finally
+ {
+ unregisterClassLoader(clA);
+ }
+ }
- public void testReminder()
+
+ public void testUndeployParentDomainClassLoader() throws Exception
{
- //This is a reminder that the commented tests further down need porting to jboss-cl
- //The tests in this class are originally from UclClassLoaderSanityTestCase
- fail("Remaining tests need to be ported to jboss cl. See comment in code :-)");
+ ClassLoader globalA = null;
+ ClassLoader globalB = null;
+ ClassLoader child = null;
+ try
+ {
+ try
+ {
+ globalA = createClassLoader("A", true, JAR_A_1);
+ assertCannotLoadClass(globalA, CLASS_B);
+
+ child = createChildDomainParentLastClassLoader("C", "C", true, JAR_C_1);
+ assertCannotLoadClass(child, CLASS_B);
+
+ globalB = createClassLoader("B", true, JAR_B_1);
+ Class<?> bFromChild = child.loadClass(CLASS_B);
+ Class<?> bFromA = globalA.loadClass(CLASS_B);
+ assertSame(globalB, bFromA.getClassLoader());
+ assertSame(bFromA, bFromChild);
+ }
+ finally
+ {
+ unregisterClassLoader(globalB);
+ }
+ assertCannotLoadClass(child, CLASS_B);
+ }
+ finally
+ {
+ unregisterClassLoader(globalA);
+ unregisterClassLoader(child);
+ unregisterDomain(getChildDomainForLoader(child));
+ }
}
-// public void testChildOverrideWithNoParentDelegation() throws Exception
-// {
-// ClassLoader clGlobal = null;
-// try
-// {
-// clGlobal = createGlobalClassLoader(JAR_A_1);
-// ClassLoader clScoped = createChildClassLoader(JAR_A_2, false);
-// Class<?> aFromParent = clGlobal.loadClass(CLASS_A);
-// assertNotNull(aFromParent);
-// Class<?> aFromChild = clScoped.loadClass(CLASS_A);
-// assertNotNull(aFromChild);
-// assertNotSame(aFromParent, aFromChild);
-// assertSame(clGlobal, aFromParent.getClassLoader());
-// assertSame(clScoped, aFromChild.getClassLoader());
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(clGlobal);
-// }
-// }
-//
-// public void testURLChildOfGlobalUcl() throws Exception
-// {
-// ClassLoader clGlobal = null;
-// try
-// {
-// clGlobal = createGlobalClassLoader(JAR_A_1);
-// ClassLoader clChildA = createChildURLClassLoader(clGlobal, JAR_B_1);
-//
-// Class<?> aFromA = clChildA.loadClass(CLASS_A);
-// assertSame(clGlobal, aFromA.getClassLoader());
-// Class<?> bFromA = clChildA.loadClass(CLASS_B);
-// assertSame(clChildA, bFromA.getClassLoader());
-//
-// ClassLoader clChildB = createChildURLClassLoader(clGlobal, JAR_A_2);
-// Class<?> aFromB = clChildB.loadClass(CLASS_A);
-// assertSame(clGlobal, aFromB.getClassLoader());
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(clGlobal);
-// }
-// }
-//
-// public void testUndeploySibling() throws Exception
-// {
-// ClassLoader clA = null;
-// ClassLoader clB = null;
-// try
-// {
-// try
-// {
-// clA = createGlobalClassLoader(JAR_A_1);
-// assertCannotLoadClass(clA, CLASS_B);
-//
-// clB = createGlobalClassLoader(JAR_B_1);
-// Class<?> bFromA = clA.loadClass(CLASS_B);
-// assertSame(clB, bFromA.getClassLoader());
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(clB);
-// }
-// assertCannotLoadClass(clA, CLASS_B);
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(clA);
-// }
-// }
-//
-//
-//// public void testUndeployParentDomainClassLoader() throws Exception
-//// {
-//// ClassLoader globalA = null;
-//// ClassLoader globalB = null;
-//// ClassLoader child = null;
-//// try
-//// {
-//// try
-//// {
-//// globalA = createGlobalClassLoader(JAR_A_1);
-//// assertCannotLoadClass(globalA, CLASS_B);
-////
-//// child = createChildClassLoader(JAR_C_1, true);
-//// assertCannotLoadClass(child, CLASS_B);
-////
-//// globalB = createGlobalClassLoader(JAR_B_1);
-//// Class<?> bFromChild = child.loadClass(CLASS_B);
-//// Class<?> bFromA = globalA.loadClass(CLASS_B);
-//// assertSame(globalB, bFromA.getClassLoader());
-//// assertSame(bFromA, bFromChild);
-//// }
-//// finally
-//// {
-//// removeClassLoaderFromRepository(globalB);
-//// }
-//// assertCannotLoadClass(child, CLASS_B);
-//// }
-//// finally
-//// {
-//// removeClassLoaderFromRepository(globalA);
-//// }
-//// }
-//
-// public void testUclWithParentClassLoader() throws Exception
-// {
-// ClassLoader parent = createChildURLClassLoader(null, JAR_B_1);
-// ClassLoader global = null;
-// try
-// {
-// global = createGlobalClassLoaderWithParent(JAR_A_1, parent);
-// Class<?> aFromGlobal = global.loadClass(CLASS_A);
-// assertSame(global, aFromGlobal.getClassLoader());
-// Class<?> bFromGlobal = global.loadClass(CLASS_B);
-// assertSame(parent, bFromGlobal.getClassLoader());
-// Class<?> bFromParent = parent.loadClass(CLASS_B);
-// assertSame(bFromGlobal, bFromParent);
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(global);
-// }
-// }
-//
-//
-// public void testUclWithParentClassLoaderAndSameClassInDomain() throws Exception
-// {
-// ClassLoader parent = createChildURLClassLoader(null, JAR_B_1);
-// ClassLoader globalA = null;
-// ClassLoader globalB = null;
-// try
-// {
-// globalA = createGlobalClassLoaderWithParent(JAR_A_1, parent);
-// Class<?> aFromGlobal = globalA.loadClass(CLASS_A);
-// assertSame(globalA, aFromGlobal.getClassLoader());
-//
-// globalB = createGlobalClassLoader(JAR_B_2);
-// Class<?> bFromGlobalA = globalA.loadClass(CLASS_B);
-// assertSame(globalB, bFromGlobalA.getClassLoader());
-// Class<?> bFromParent = parent.loadClass(CLASS_B);
-// assertSame(parent, bFromParent.getClassLoader());
-// assertNotSame(bFromGlobalA, bFromParent);
-// }
-// finally
-// {
-// removeClassLoaderFromRepository(globalA);
-// removeClassLoaderFromRepository(globalB);
-// }
-// }
-//
-//
+ public void testClassLoaderlWithParentClassLoader() throws Exception
+ {
+ ClassLoader parent = createChildURLClassLoader(null, JAR_B_1);
+ ClassLoader global = null;
+ try
+ {
+ global = createChildDomainParentFirstClassLoader("A", "A", true, parent, JAR_A_1);
+ Class<?> aFromGlobal = global.loadClass(CLASS_A);
+ assertSame(global, aFromGlobal.getClassLoader());
+ Class<?> bFromGlobal = global.loadClass(CLASS_B);
+ assertSame(parent, bFromGlobal.getClassLoader());
+ Class<?> bFromParent = parent.loadClass(CLASS_B);
+ assertSame(bFromGlobal, bFromParent);
+ }
+ finally
+ {
+ unregisterClassLoader(global);
+ unregisterClassLoader(parent);
+ unregisterDomain(getChildDomainForLoader(global));
+ }
+ }
+
+
+ public void testClassLoaderWithParentClassLoaderAndSameClassInDomain() throws Exception
+ {
+ ClassLoader parent = createChildURLClassLoader(null, JAR_B_1);
+ ClassLoader globalA = null;
+ ClassLoader globalB = null;
+ try
+ {
+ final String domain = "CHILD";
+ globalA = createChildDomainParentFirstClassLoader("A", domain, true, parent, JAR_A_1);
+ Class<?> aFromGlobal = globalA.loadClass(CLASS_A);
+ assertSame(globalA, aFromGlobal.getClassLoader());
+
+ globalB = createChildDomainParentFirstClassLoader("B", domain, true, parent, JAR_B_1);
+ Class<?> bFromGlobalA = globalA.loadClass(CLASS_B);
+ assertSame(globalB, bFromGlobalA.getClassLoader());
+ Class<?> bFromParent = parent.loadClass(CLASS_B);
+ assertSame(parent, bFromParent.getClassLoader());
+ assertNotSame(bFromGlobalA, bFromParent);
+ }
+ finally
+ {
+ unregisterClassLoader(globalA);
+ unregisterClassLoader(globalB);
+ unregisterClassLoader(parent);
+ unregisterDomain(getChildDomainForLoader(globalA));
+ }
+ }
+
+
}
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassPoolWithRepositoryTestCase.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -52,8 +52,8 @@
ClassPool poolB = null;
try
{
- poolA = createClassPool("A", true, PACKAGE_A);
- poolB = createClassPool("B", true, PACKAGE_B);
+ poolA = createClassPool("A", true, JAR_A_1);
+ poolB = createClassPool("B", true, JAR_B_1);
try
{
CtClass aFromA = poolA.get(CLASS_A);
@@ -89,13 +89,13 @@
ClassPool poolC = null;
try
{
- poolA = createClassPool("A", true, PACKAGE_A);
- poolB = createClassPool("B", true, PACKAGE_B);
- poolC = createChildDomainParentFirstClassPool("C", "CHILD", true, PACKAGE_C);
+ poolA = createClassPool("A", true, JAR_A_1);
+ poolB = createClassPool("B", true, JAR_B_1);
+ poolC = createChildDomainParentFirstClassPool("C", "CHILD", true, JAR_C_1);
childDomain = getChildDomainForPool(poolC);
assertNotNull(childDomain);
- assertSame(helper.getDomain(), childDomain.getParent());
+ assertSame(getSystem().getDefaultDomain(), childDomain.getParent());
CtClass aFromA = poolA.get(CLASS_A);
assertNotNull(aFromA);
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/JBossClClassPoolTest.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/JBossClClassPoolTest.java 2008-12-03 20:34:41 UTC (rev 82018)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/JBossClClassPoolTest.java 2008-12-03 20:47:56 UTC (rev 82019)
@@ -23,8 +23,8 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLClassLoader;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
@@ -37,18 +37,16 @@
import org.jboss.aop.classpool.jbosscl.JBossClClassPoolFactory;
import org.jboss.classloader.plugins.filter.PatternClassFilter;
import org.jboss.classloader.spi.ClassLoaderDomain;
-import org.jboss.classloader.spi.ClassLoaderPolicy;
import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloader.spi.DelegateLoader;
import org.jboss.classloader.spi.filter.ClassFilter;
import org.jboss.classloader.test.support.IsolatedClassLoaderTestHelper;
-import org.jboss.classloader.test.support.MockClassLoaderPolicy;
+import org.jboss.classloading.spi.dependency.ClassLoading;
import org.jboss.classloading.spi.dependency.Module;
-import org.jboss.classloading.spi.dependency.policy.mock.MockClassLoaderPolicyModule;
-import org.jboss.classloading.spi.dependency.policy.mock.MockClassLoadingMetaData;
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
import org.jboss.test.AbstractTestCaseWithSetup;
import org.jboss.test.AbstractTestDelegate;
-import org.jboss.test.aop.classpool.jbosscl.support.TestMockClassLoaderPolicyModule;
+import org.jboss.test.aop.classpool.jbosscl.support.MockModuleFactory;
+import org.jboss.virtual.VFS;
/**
* Base class for testing the new JBoss classloaders
@@ -59,12 +57,12 @@
public class JBossClClassPoolTest extends AbstractTestCaseWithSetup
{
//These might not be needed with the new loaders
-// public final static URL JAR_A_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-a1.jar");
-// public final static URL JAR_A_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-a2.jar");
-// public final static URL JAR_B_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-b1.jar");
-// public final static URL JAR_B_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-b2.jar");
-// public final static URL JAR_C_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-c1.jar");
-// public final static URL JAR_C_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-jmx-test-classpool-c2.jar");
+ public final static URL JAR_A_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-a1.jar");
+ public final static URL JAR_A_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-a2.jar");
+ public final static URL JAR_B_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-b1.jar");
+ public final static URL JAR_B_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-b2.jar");
+ public final static URL JAR_C_1 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-c1.jar");
+ public final static URL JAR_C_2 = getURLRelativeToProjectRoot("target/jboss-aop-asintegration-mc-test-classpool-c2.jar");
public static final String PACKAGE_ROOT = "org.jboss.test.aop.classpool.jbosscl.support";
public static final String PACKAGE_A = PACKAGE_ROOT + ".a";
@@ -78,16 +76,23 @@
//Keep strong references to the Modules since the domainRegistry only has weak references
private Set<Module> modules = new HashSet<Module>();
+ //Keep a strong reference to the URL classloaders so that they are not garbage collected
+ final static Set<URLClassLoader> registeredURLClassLoaders = new HashSet<URLClassLoader>();
+
private Map<ClassLoader, ClassLoaderDomain> scopedChildDomainsByLoader = new WeakHashMap<ClassLoader, ClassLoaderDomain>();
/** The classloader helper */
- protected static IsolatedClassLoaderTestHelper helper;
+ //protected static IsolatedClassLoaderTestHelper helper;
+ protected static final ClassLoaderSystem system = ClassLoaderSystem.getInstance();
protected static VFSClassLoaderDomainRegistry domainRegistry;
+ ClassLoading classLoading = new ClassLoading();
+
static
{
domainRegistry = new VFSClassLoaderDomainRegistry();
AspectManager.setClassPoolFactory(new JBossClClassPoolFactory(domainRegistry));
+ VFS.init();
}
@@ -103,9 +108,26 @@
public static Test suite(Class<?> clazz, boolean importAll, Class<?>... packages)
{
- helper = new IsolatedClassLoaderTestHelper();
- ClassFilter aopFilter = new PatternClassFilter(new String[] { "org\\.jboss\\.aop\\..+", "org\\.jboss\\.metadata\\..+"}, new String[] { "org/jboss/aop/.+", "org/jboss/metadata/.+"}, null);
+ IsolatedClassLoaderTestHelper helper = new IsolatedClassLoaderTestHelper();
+
+ String[] classPatterns = new String[] {
+ "org\\.jboss\\.aop\\..+",
+ "org\\.jboss\\.classloading\\..+",
+ "org\\.jboss\\.classloader\\..+",
+ "org\\.jboss\\.virtual\\..+",
+ "org\\.jboss\\.test\\.aop\\.classpool\\.jbosscl\\..+\\..+",
+ "org\\.jboss\\.metadata\\..+"};
+ String[] resourcePatterns = new String[] {
+ "org/jboss/aop/.+",
+ "org/jboss/classloading/.+",
+ "org/jboss/classloader/.+",
+ "org/jboss/virtual/.+",
+ "org/jboss/test/aop/classpool/jbosscl/.+\\..+",
+ "org/jboss/metadata/.+"};
+ ClassFilter aopFilter = new PatternClassFilter(classPatterns, resourcePatterns, null);
Class<?> newClass = helper.initializeClassLoader(clazz, aopFilter, importAll, packages);
+ System.out.println(clazz.getClassLoader());
+ System.out.println(newClass.getClassLoader());
return AbstractTestCaseWithSetup.suite(newClass);
}
@@ -138,50 +160,82 @@
throw new RuntimeException(e);
}
}
+
+ protected ClassLoaderSystem getSystem()
+ {
+ return system;
+ }
+
+ protected ClassLoaderDomain getDefaultDomain()
+ {
+ return system.getDefaultDomain();
+ }
-
- protected ClassLoader createChildDomainParentFirstClassLoader(String name, String domainName, boolean importAll, String... packages) throws Exception
+ protected ClassLoader createClassLoader(String name, boolean importAll, URL... urls) throws Exception
{
- return createChildDomainClassLoader(name, domainName, true, importAll, packages);
+ ClassLoaderPolicyModule module = MockModuleFactory.createModule(name, importAll, urls);
+ return createClassLoader(module);
}
- protected ClassLoader createChildDomainParentLastClassLoader(String name, String domainName, boolean importAll, String... packages) throws Exception
+ protected ClassLoader createClassLoader(String name, boolean importAll, ClassLoader parent, URL... urls) throws Exception
{
- return createChildDomainClassLoader(name, domainName, false, importAll, packages);
+ ClassLoaderPolicyModule module = MockModuleFactory.createModule(name, importAll, urls);
+ return createClassLoader(module, parent);
}
- protected ClassLoader createChildDomainClassLoader(String name, String domainName, boolean parentFirst, boolean importAll, String... packages) throws Exception
+ protected ClassLoader createClassLoader(ClassLoaderPolicyModule module)
{
- ClassLoaderDomain domain = helper.getSystem().getDomain(domainName);
- if (domain == null)
- {
- if (parentFirst)
- {
- domain = createScopedClassLoaderDomainParentFirst(domainName);
- }
- else
- {
- domain = createScopedClassLoaderDomainParentLast(domainName);
- }
- }
- MockClassLoadingMetaData metaData = createClassLoadingMetaData(name);
- metaData.setDomain(domainName);
- metaData.setParentDomain(domain.getParentDomainName());
- metaData.setJ2seClassLoadingCompliance(parentFirst);
- metaData.setImportAll(importAll);
- metaData.setPathsAndPackageNames(packages);
- MockClassLoaderPolicyModule module = new MockClassLoaderPolicyModule(metaData, name);
+ return createClassLoader(module, null);
+ }
+
+ protected ClassLoader createClassLoader(ClassLoaderPolicyModule module, ClassLoader parent)
+ {
+ classLoading.addModule(module);
+ ClassLoader loader = parent == null ?
+ module.registerClassLoaderPolicy(system) : module.registerClassLoaderPolicy(system, parent);
+ registerModule(loader, module);
+ return loader;
+ }
+
+ protected ClassLoader createChildDomainParentFirstClassLoader(String name, String domainName, boolean importAll, URL... urls) throws Exception
+ {
+ return createChildDomainParentFirstClassLoader(name, domainName, importAll, null, urls);
+ }
+
+ protected ClassLoader createChildDomainParentFirstClassLoader(String name, String domainName, boolean importAll, ClassLoader parent, URL... urls) throws Exception
+ {
+ return createChildDomainClassLoader(name, domainName, true, importAll, parent, urls);
+ }
+
+ protected ClassLoader createChildDomainParentLastClassLoader(String name, String domainName, boolean importAll, URL... urls) throws Exception
+ {
+ return createChildDomainParentLastClassLoader(name, domainName, importAll, null, urls);
+ }
+
+ protected ClassLoader createChildDomainParentLastClassLoader(String name, String domainName, boolean importAll, ClassLoader parent, URL... urls) throws Exception
+ {
+ return createChildDomainClassLoader(name, domainName, false, importAll, parent, urls);
+ }
+
+ protected ClassLoader createChildDomainClassLoader(String name, String domainName, boolean parentFirst, boolean importAll, ClassLoader parent, URL... urls) throws Exception
+ {
+ ClassLoaderPolicyModule module = MockModuleFactory.createModule(name, importAll, domainName, parentFirst, urls);
- MockClassLoaderPolicy policy = new MockClassLoaderPolicy(name);
- policy.setImportAll(importAll);
- policy.setPathsAndPackageNames(packages);
- ClassLoader classLoader = createClassLoader(domain, policy);
-
+ ClassLoader classLoader = createClassLoader(module, parent);
+
+ ClassLoaderDomain domain = system.getDomain(domainName);
scopedChildDomainsByLoader.put(classLoader, domain);
registerModule(classLoader, module);
return classLoader;
}
+ protected ClassLoader createChildURLClassLoader(ClassLoader parent, URL url)
+ {
+ URLClassLoader cl = new URLClassLoader(new URL[] {url}, parent);
+ registeredURLClassLoaders.add(cl);
+ return cl;
+ }
+
/**
* Here since we cannot access this via the classloading api
*/
@@ -199,7 +253,12 @@
{
if (domain != null)
{
- helper.unregisterDomain(domain.getName());
+ ClassLoaderDomain registeredDomain = system.getDomain(domain.getName());
+ if (registeredDomain == null)
+ throw new IllegalStateException("Domain is not registered: " + domain.getName());
+ if (registeredDomain != domain)
+ throw new IllegalStateException(domain + " is not the same as " + registeredDomain);
+ system.unregisterDomain(domain);
}
}
@@ -241,33 +300,30 @@
{
}
}
-
- protected MockClassLoadingMetaData createClassLoadingMetaData(String name)
+
+ protected ClassPool createClassPool(String name, boolean importAll, URL... urls) throws Exception
{
- MockClassLoadingMetaData metaData = new MockClassLoadingMetaData(name);
- //These should always be set
- metaData.setBlackListable(true);
- metaData.setCacheable(true);
- //Default to the test domain
- metaData.setDomain(helper.getDomain().getName());
- metaData.setParentDomain(helper.getDomain().getParentDomainName());
- return metaData;
+ ClassLoader loader = createClassLoader(name, importAll, urls);
+ return AspectManager.instance().registerClassLoader(loader);
}
- protected MockClassLoadingMetaData createClassLoadingMetaDataFromPolicy(MockClassLoaderPolicy policy)
+ protected ClassPool createChildDomainParentFirstClassPool(String name, String domainName, boolean importAll, URL... urls) throws Exception
{
- MockClassLoadingMetaData metaData = createClassLoadingMetaData(policy.getName());
- metaData.setImportAll(policy.isImportAll());
- metaData.setPathsAndPackageNames(policy.getPackageNames());
- //TODO should set more OSGi stuff in metaData here
- return metaData;
+ ClassLoader loader = createChildDomainParentFirstClassLoader(name, domainName, importAll, urls);
+ return AspectManager.instance().registerClassLoader(loader);
}
- protected void registerModule(ClassLoader loader, MockClassLoaderPolicyModule module)
+ protected ClassPool createChildDomainParentLastClassPool(String name, String domainName, boolean importAll, URL... urls) throws Exception
{
- if (helper.getSystem() != domainRegistry.getSystem())
+ ClassLoader loader = createChildDomainParentLastClassLoader(name, domainName, importAll, urls);
+ return AspectManager.instance().registerClassLoader(loader);
+ }
+
+ protected void registerModule(ClassLoader loader, ClassLoaderPolicyModule module)
+ {
+ if (system != domainRegistry.getSystem())
{
- domainRegistry.setSystem(helper.getSystem());
+ domainRegistry.setSystem(system);
}
//Add the hard reference to the Module since the registry's reference is weak
//In the real workd this would be maintained by the deployers
@@ -288,11 +344,11 @@
protected void assertModule(ClassLoader loader)
{
- ClassLoaderSystem system = helper.getSystem();
ClassLoaderDomain domainForLoader = scopedChildDomainsByLoader.get(loader);
if (domainForLoader == null)
{
- domainForLoader = helper.getDomain();
+ //domainForLoader = helper.getDomain();
+ domainForLoader = system.getDefaultDomain();
}
assertNotNull(domainForLoader);
@@ -306,168 +362,43 @@
assertEquals(domainForModule.getParentDomainName(), module.getParentDomainName());
}
- protected ClassPool createClassPool(String name, boolean importAll, String... packages) throws Exception
- {
- ClassLoader loader = createClassLoader(name, importAll, packages);
- return AspectManager.instance().registerClassLoader(loader);
- }
-
- protected ClassPool createChildDomainParentFirstClassPool(String name, String domainName, boolean importAll, String... packages) throws Exception
- {
- ClassLoader loader = createChildDomainParentFirstClassLoader(name, domainName, importAll, packages);
- return AspectManager.instance().registerClassLoader(loader);
- }
-
- protected ClassPool createChildDomainParentLastClassPool(String name, String domainName, boolean importAll, String... packages) throws Exception
- {
- ClassLoader loader = createChildDomainParentLastClassLoader(name, domainName, importAll, packages);
- return AspectManager.instance().registerClassLoader(loader);
- }
-
protected void unregisterClassPool(ClassPool pool) throws Exception
{
- ClassLoader loader = pool.getClassLoader();
- AspectManager.instance().unregisterClassLoader(loader);
- if (loader != null)
+ if (pool != null)
{
- unregisterClassLoader(loader);
+ ClassLoader loader = pool.getClassLoader();
+ AspectManager.instance().unregisterClassLoader(loader);
+ if (loader != null)
+ {
+ unregisterClassLoader(loader);
+ }
}
}
- ////////////////////////////////////////////////////////////////////////
- // These are lifted from AOPIntegrationTest, but have some modifications
- /**
- * Create a classloader
- *
- * It exports everything
- *
- * @param name the name
- * @param importAll whether to import all
- * @param packages the packages
- * @return the classloader
- * @throws Exception for any error
- */
- protected ClassLoader createClassLoader(String name, boolean importAll, String... packages) throws Exception
- {
- MockClassLoadingMetaData metaData = createClassLoadingMetaData(name);
- metaData.setImportAll(importAll);
- metaData.setPathsAndPackageNames(packages);
- metaData.setDomain(helper.getDomain().getName());
- TestMockClassLoaderPolicyModule module = new TestMockClassLoaderPolicyModule(metaData, name);
-
- ClassLoader loader = helper.createClassLoader(name, importAll, packages);
- registerModule(loader, module);
-
- return loader;
- }
-
- /**
- * Create a classloader
- *
- * It exports everything
- *
- * @param name the name
- * @param importAll whether to import all
- * @param packages the packages
- * @return the classloader
- * @throws Exception for any error
- */
- protected ClassLoader createClassLoader(MockClassLoaderPolicy policy) throws Exception
- {
- MockClassLoadingMetaData metaData = createClassLoadingMetaDataFromPolicy(policy);
- TestMockClassLoaderPolicyModule module = new TestMockClassLoaderPolicyModule(metaData, policy.getName());
-
- ClassLoader loader = helper.createClassLoader(policy);
- registerModule(loader, module);
- return loader;
- }
-
- /**
- * Create a scoped classloader domain using the test domain as parent
- * using the parent first policy
- *
- * @param name the name
- * @return the domain
- */
- public ClassLoaderDomain createScopedClassLoaderDomainParentFirst(String name)
- {
- return helper.createScopedClassLoaderDomainParentFirst(name);
- }
-
- /**
- * Create a scoped classloader domain using the test domain as parent
- * using the parent last policy
- *
- * @param name the name
- * @return the domain
- */
- public ClassLoaderDomain createScopedClassLoaderDomainParentLast(String name)
- {
- return helper.createScopedClassLoaderDomainParentLast(name);
- }
-
- /**
- * Create a classloader
- *
- * @param domain the domain
- * @param policy the policy
- * @return the classloader
- * @throws Exception for any error
- */
- public ClassLoader createClassLoader(ClassLoaderDomain domain, MockClassLoaderPolicy policy) throws Exception
- {
- MockClassLoadingMetaData metaData = createClassLoadingMetaDataFromPolicy(policy);
- metaData.setDomain(domain.getName());
- metaData.setParentDomain(domain.getParentDomainName());
- TestMockClassLoaderPolicyModule module = new TestMockClassLoaderPolicyModule(metaData, policy.getName());
-
- ClassLoader loader = helper.createClassLoader(domain, policy);
- registerModule(loader, module);
- return loader;
- }
-
- /**
- * Unregister a classloader
- *
- * @param classLoader the classloader
- * @throws Exception for any error
- */
protected void unregisterClassLoader(ClassLoader classLoader) throws Exception
{
- unregisterModule(classLoader);
- helper.unregisterClassLoader(classLoader);
+ if (classLoader != null)
+ {
+ if (registeredURLClassLoaders.remove(classLoader) == false)
+ {
+ unregisterModule(classLoader);
+ system.unregisterClassLoader(classLoader);
+ }
+ }
}
/**
- * Create the default delegate loader
- *
- * @return the loaders
- */
- public List<? extends DelegateLoader> createDefaultDelegates()
- {
- return helper.createDefaultDelegates();
- }
-
- /**
- * Create delegate loaders from policies
- *
- * @param policies the policies
- * @return the loaders
- */
- public List<? extends DelegateLoader> createDelegates(ClassLoaderPolicy... policies)
- {
- return helper.createDelegates(policies);
- }
-
-
- /**
* Unregister a domain
*
* @param name the domain name
*/
public void unregisterDomain(String name)
{
- helper.unregisterDomain(name);
+ if (name != null)
+ {
+ ClassLoaderDomain registeredDomain = system.getDomain(name);
+ unregisterDomain(registeredDomain);
+ }
}
}
More information about the jboss-cvs-commits
mailing list