[jboss-cvs] JBossAS SVN: r61276 - in trunk/testsuite: src/main/org/jboss/test/classloader/leak and 17 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Mar 11 23:50:16 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-03-11 23:50:16 -0400 (Sun, 11 Mar 2007)
New Revision: 61276

Added:
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatefulSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSessionHome.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/Ejb3Servlet.java
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-ejb3.xml
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-jcl.xml
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-noweb-ejb3.xml
   trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/jcl/MANIFEST.MF
   trunk/testsuite/src/resources/classloader/leak/ejb3/
   trunk/testsuite/src/resources/classloader/leak/ejb3/META-INF/
   trunk/testsuite/src/resources/classloader/leak/ejb3/META-INF/MANIFEST.MF
   trunk/testsuite/src/resources/classloader/leak/war/ejb2/
   trunk/testsuite/src/resources/classloader/leak/war/ejb2/WEB-INF/
   trunk/testsuite/src/resources/classloader/leak/war/ejb2/WEB-INF/web.xml
   trunk/testsuite/src/resources/classloader/leak/war/ejb2/ejb.jsp
   trunk/testsuite/src/resources/classloader/leak/war/ejb3/
   trunk/testsuite/src/resources/classloader/leak/war/ejb3/WEB-INF/
   trunk/testsuite/src/resources/classloader/leak/war/ejb3/WEB-INF/web.xml
   trunk/testsuite/src/resources/classloader/leak/war/ejb3/ejb.jsp
Removed:
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-nolink.xml
Modified:
   trunk/testsuite/imports/sections/classloader.xml
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatelessSessionBean.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSession.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSessionHome.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/ClassloaderLeakContextListener.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/EjbServlet.java
   trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleServlet.java
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-dual.xml
   trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application.xml
   trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/MANIFEST.MF
   trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/ejb-jar.xml
   trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/web.xml
   trunk/testsuite/src/resources/classloader/leak/war/simple.jsp
Log:
[JBAS-4190] Add EJB2 SFSB and EJB3 Session bean testing to ClassloaderLeakUnitTestCase

Modified: trunk/testsuite/imports/sections/classloader.xml
===================================================================
--- trunk/testsuite/imports/sections/classloader.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/imports/sections/classloader.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -435,25 +435,28 @@
       	<include name="jboss-profiler-jvmti.jar"/>
       </fileset>
     </jar>
+   	
     <war destfile="${build.lib}/classloader-leak-simple.war"
-        webxml="${build.resources}/classloader/leak/war/WEB-INF/web-simple.xml">
+        webxml="${build.resources}/classloader/leak/war/WEB-INF/web.xml">
     	<webinf dir="${build.resources}/classloader/leak/war/WEB-INF">
     		<include name="jboss-web.xml"/>
     	</webinf>
     	<classes dir="${build.classes}">
     		<include name="org/jboss/test/classloader/leak/web/*"/>
+    		<exclude name="org/jboss/test/classloader/leak/web/Ejb*"/>
     	</classes>
         <fileset dir="${build.resources}/classloader/leak/war">
           <include name="simple.jsp"/>
         </fileset>
     </war>
     <war destfile="${build.lib}/classloader-leak-in-war.war"
-        webxml="${build.resources}/classloader/leak/war/WEB-INF/web-simple.xml">
+        webxml="${build.resources}/classloader/leak/war/WEB-INF/web.xml">
     	<webinf dir="${build.resources}/classloader/leak/war/WEB-INF">
     		<include name="jboss-web.xml"/>
     	</webinf>
     	<classes dir="${build.classes}">
     		<include name="org/jboss/test/classloader/leak/web/*"/>
+    		<exclude name="org/jboss/test/classloader/leak/web/Ejb*"/>
     	</classes>
         <fileset dir="${build.resources}/classloader/leak/war">
           <include name="simple.jsp"/>
@@ -463,22 +466,30 @@
     	</lib>
     </war>
     <war destfile="${build.lib}/classloader-leak-simple-ejb.war"
-        webxml="${build.resources}/classloader/leak/war/WEB-INF/web.xml">
+        webxml="${build.resources}/classloader/leak/war/ejb2/WEB-INF/web.xml">
     	<classes dir="${build.classes}">
     		<include name="org/jboss/test/classloader/leak/web/*"/>
+    		<exclude name="org/jboss/test/classloader/leak/web/Ejb3Servlet"/>
     	</classes>
         <fileset dir="${build.resources}/classloader/leak/war">
           <include name="*.jsp"/>
         </fileset>
+        <fileset dir="${build.resources}/classloader/leak/war/ejb2">
+          <include name="*.jsp"/>
+        </fileset>
     </war>
     <war destfile="${build.lib}/classloader-leak-in-war-ejb.war"
-        webxml="${build.resources}/classloader/leak/war/WEB-INF/web.xml">
+        webxml="${build.resources}/classloader/leak/war/ejb2/WEB-INF/web.xml">
+    	<classes dir="${build.classes}">
+    		<include name="org/jboss/test/classloader/leak/web/*"/>
+    		<exclude name="org/jboss/test/classloader/leak/web/Ejb3Servlet"/>
+    	</classes>
         <fileset dir="${build.resources}/classloader/leak/war">
           <include name="*.jsp"/>
         </fileset>
-    	<classes dir="${build.classes}">
-    		<include name="org/jboss/test/classloader/leak/web/*"/>
-    	</classes>
+        <fileset dir="${build.resources}/classloader/leak/war/ejb2">
+          <include name="*.jsp"/>
+        </fileset>
     	<lib dir="${apache.logging.lib}">
     		<include name="commons-logging.jar"/>
     	</lib>
@@ -490,6 +501,13 @@
         <include name="org/jboss/test/classloader/leak/ejb/**"/>
       </fileset>
     </jar>
+    <jar destfile="${build.lib}/classloader-leak-ejb-jcl.jar"
+    	manifest="${build.resources}/classloader/leak/ejb/META-INF/jcl/MANIFEST.MF">
+      <metainf dir="${build.resources}/classloader/leak/ejb/META-INF"/>
+      <fileset dir="${build.classes}">
+        <include name="org/jboss/test/classloader/leak/ejb/**"/>
+      </fileset>
+    </jar>
   	<ear destfile="${build.lib}/classloader-leak-simple.ear"
   	  appxml="${build.resources}/classloader/leak/ear/META-INF/application.xml">
   		<fileset dir="${build.lib}">
@@ -526,23 +544,23 @@
   	<copy todir="${build.resources}/classloader/leak/ear/lib"
   	    file="${apache.logging.lib}/commons-logging.jar"/>
   	<ear destfile="${build.lib}/classloader-leak-in-ear.ear"
-  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application.xml">
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-jcl.xml">
   		<fileset dir="${build.lib}">
   			<include name="classloader-leak-simple-ejb.war"/>
-  			<include name="classloader-leak-ejb.jar"/>
+  			<include name="classloader-leak-ejb-jcl.jar"/>
   		</fileset>
   		<fileset dir="${build.resources}/classloader/leak/ear">
   			<include name="lib/**"/>
   		</fileset>
     </ear>
   	<ear destfile="${build.lib}/classloader-leak-in-ear-isolated.ear"
-  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application.xml">
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-jcl.xml">
   		<metainf dir="${build.resources}/classloader/leak/ear/META-INF">
   			<include name="jboss-app.xml"/>
   		</metainf>
   		<fileset dir="${build.lib}">
   			<include name="classloader-leak-simple-ejb.war"/>
-  			<include name="classloader-leak-ejb.jar"/>
+  			<include name="classloader-leak-ejb-jcl.jar"/>
   		</fileset>
   		<fileset dir="${build.resources}/classloader/leak/ear">
   			<include name="lib/**"/>
@@ -552,7 +570,7 @@
   	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-dual.xml">
   		<fileset dir="${build.lib}">
   			<include name="classloader-leak-in-war-ejb.war"/>
-  			<include name="classloader-leak-ejb.jar"/>
+  			<include name="classloader-leak-ejb-jcl.jar"/>
   		</fileset>
   		<fileset dir="${build.resources}/classloader/leak/ear">
   			<include name="lib/**"/>
@@ -565,11 +583,66 @@
   		</metainf>
   		<fileset dir="${build.lib}">
   			<include name="classloader-leak-in-war-ejb.war"/>
-  			<include name="classloader-leak-ejb.jar"/>
+  			<include name="classloader-leak-ejb-jcl.jar"/>
   		</fileset>
   		<fileset dir="${build.resources}/classloader/leak/ear">
   			<include name="lib/**"/>
   		</fileset>
     </ear> 	
-   </target>
+  	
+  	<!-- EJB3 versions of the classloader leak deployments -->
+    <war destfile="${build.lib}/classloader-leak-simple-ejb3.war"
+        webxml="${build.resources}/classloader/leak/war/ejb3/WEB-INF/web.xml">
+    	<classes dir="${build.classes}">
+    		<include name="org/jboss/test/classloader/leak/web/*"/>
+    		<exclude name="org/jboss/test/classloader/leak/web/EjbServlet"/>
+    	</classes>
+        <fileset dir="${build.resources}/classloader/leak/war">
+          <include name="*.jsp"/>
+        </fileset>
+        <fileset dir="${build.resources}/classloader/leak/war/ejb3">
+          <include name="*.jsp"/>
+        </fileset>
+    </war>
+    <jar destfile="${build.lib}/classloader-leak-ejb3.jar"
+    	manifest="${build.resources}/classloader/leak/ejb3/META-INF/MANIFEST.MF">
+      <metainf dir="${build.resources}/classloader/leak/ejb3/META-INF"/>
+      <fileset dir="${build.classes}">
+        <include name="org/jboss/test/classloader/leak/ejb3/**"/>
+      </fileset>
+    </jar>
+  	<ear destfile="${build.lib}/classloader-leak-simple-ejb3.ear"
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-ejb3.xml">
+  		<fileset dir="${build.lib}">
+  			<include name="classloader-leak-simple-ejb3.war"/>
+		    <include name="classloader-leak-ejb3.jar"/>
+  		</fileset>
+    </ear>
+  	<ear destfile="${build.lib}/classloader-leak-simple-isolated-ejb3.ear"
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-ejb3.xml">
+  		<metainf dir="${build.resources}/classloader/leak/ear/META-INF">
+  			<include name="jboss-app.xml"/>
+  		</metainf>
+  		<fileset dir="${build.lib}">
+  			<include name="classloader-leak-simple-ejb3.war"/>
+            <include name="classloader-leak-ejb3.jar"/>
+  		</fileset>
+    </ear> 	
+  	<ear destfile="${build.lib}/classloader-leak-noweb-ejb3.ear"
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-noweb-ejb3.xml">
+  		<fileset dir="${build.lib}">
+            <include name="classloader-leak-ejb3.jar"/>
+  		</fileset>
+    </ear>
+  	<ear destfile="${build.lib}/classloader-leak-noweb-isolated-ejb3.ear"
+  	  appxml="${build.resources}/classloader/leak/ear/META-INF/application-noweb-ejb3.xml">
+  		<metainf dir="${build.resources}/classloader/leak/ear/META-INF">
+  			<include name="jboss-app.xml"/>
+  		</metainf>
+  		<fileset dir="${build.lib}">
+            <include name="classloader-leak-ejb3.jar"/>
+  		</fileset>
+    </ear> 	
+  	
+  </target>
 </project>

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatefulSessionBean.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatefulSessionBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatefulSessionBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatefulSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,74 @@
+/*
+ * 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.classloader.leak.ejb.bean;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Brian Stansberry
+ */
+public class StatefulSessionBean implements SessionBean
+{
+   private static final long serialVersionUID = 1L;
+   
+   private SessionContext sessionContext;
+
+   public void ejbCreate() throws RemoteException, CreateException
+   { 
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SFSB", StatefulSessionBean.class.getClassLoader());
+   }
+
+   public void ejbActivate() throws RemoteException
+   {
+      
+   }
+
+   public void ejbPassivate() throws RemoteException
+   {
+      
+   }
+
+   public void ejbRemove() throws RemoteException
+   {
+      
+   }
+
+   public void setSessionContext(SessionContext context) throws RemoteException
+   {
+      sessionContext = context;
+   }
+
+   public void log(String category)
+   {
+      Log log = LogFactory.getLog(category);
+      log.info("Logging for " + getClass().getName());  
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SFSB_TCCL", Thread.currentThread().getContextClassLoader());
+   }
+
+}

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatelessSessionBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatelessSessionBean.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/bean/StatelessSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -40,9 +40,8 @@
    private SessionContext sessionContext;
 
    public void ejbCreate() throws RemoteException, CreateException
-   {
-//      
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB", StatelessSessionBean.class.getClassLoader());
+   {     
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SLSB", StatelessSessionBean.class.getClassLoader());
    }
 
    public void ejbActivate() throws RemoteException
@@ -68,8 +67,8 @@
    public void log(String category)
    {
       Log log = LogFactory.getLog(category);
-      log.info("Logging for " + category);  
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB", Thread.currentThread().getContextClassLoader());
+      log.info("Logging for " + getClass().getName());  
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
    }
 
 }

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSession.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSession.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSession.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,34 @@
+/*
+ * 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.classloader.leak.ejb.interfaces;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * @author Brian Stansberry
+ */
+public interface StatefulSession extends EJBObject
+{
+   void log(String category) throws RemoteException;
+}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSessionHome.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSessionHome.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSessionHome.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatefulSessionHome.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,33 @@
+/*
+ * 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.classloader.leak.ejb.interfaces;
+
+import javax.ejb.*;
+import java.rmi.*;
+
+/**
+ * @author Brian Stansberry
+ */
+public interface StatefulSessionHome extends EJBHome {
+
+  public StatefulSession create() throws java.rmi.RemoteException, javax.ejb.CreateException;
+} 

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSession.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSession.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -28,7 +28,7 @@
 /**
  * @author Brian Stansberry
  */
-public interface StatelessSession extends EJBObject {
-
-  public void log(String category) throws RemoteException;;
+public interface StatelessSession extends EJBObject
+{
+   void log(String category) throws RemoteException;
 }

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSessionHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSessionHome.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb/interfaces/StatelessSessionHome.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -25,9 +25,9 @@
 import java.rmi.*;
 
 /**
- * @author Marc Fleury
+ * @author Brian Stansberry
  */
-public interface StatelessSessionHome extends EJBHome {
-
+public interface StatelessSessionHome extends EJBHome 
+{
   public StatelessSession create() throws java.rmi.RemoteException, javax.ejb.CreateException;
 } 

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3 (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3)

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java	2007-03-10 07:29:17 UTC (rev 61250)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,34 +0,0 @@
-/*
- * 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.classloader.leak.ejb3;
-
-import javax.ejb.Remote;
-
-
-/**
- * @author Brian Stansberry
- */
- at Remote
-public interface Ejb3StatefulSession 
-{
-   void log(String category);
-}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,34 @@
+/*
+ * 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.classloader.leak.ejb3;
+
+import javax.ejb.Remote;
+
+
+/**
+ * @author Brian Stansberry
+ */
+ at Remote
+public interface Ejb3StatefulSession 
+{
+   void log(String category);
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java	2007-03-10 07:29:17 UTC (rev 61250)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,50 +0,0 @@
-/*
- * 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.classloader.leak.ejb3;
-
-import javax.ejb.Stateful;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.ejb.RemoteBinding;
-
-/**
- * @author Brian Stansberry
- */
- at Stateful(name="Ejb3StatefulSession")
- at RemoteBinding(jndiBinding="Ejb3StatefulSession/remote")
- at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
-public class Ejb3StatefulSessionBean implements Ejb3StatefulSession
-{
-   private static final long serialVersionUID = 1L;
-
-   public void log(String category)
-   {
-      Log log = LogFactory.getLog(category);
-      log.info("Logging for " + getClass().getName());  
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB", Ejb3StatefulSessionBean.class.getClassLoader());
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB_TCCL", Thread.currentThread().getContextClassLoader());
-   }
-
-}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatefulSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,50 @@
+/*
+ * 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.classloader.leak.ejb3;
+
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * @author Brian Stansberry
+ */
+ at Stateful(name="Ejb3StatefulSession")
+ at RemoteBinding(jndiBinding="Ejb3StatefulSession/remote")
+ at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
+public class Ejb3StatefulSessionBean implements Ejb3StatefulSession
+{
+   private static final long serialVersionUID = 1L;
+
+   public void log(String category)
+   {
+      Log log = LogFactory.getLog(category);
+      log.info("Logging for " + getClass().getName());  
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB", Ejb3StatefulSessionBean.class.getClassLoader());
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB_TCCL", Thread.currentThread().getContextClassLoader());
+   }
+
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java	2007-03-10 07:29:17 UTC (rev 61250)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,33 +0,0 @@
-/*
- * 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.classloader.leak.ejb3;
-
-import javax.ejb.Remote;
-
-/**
- * @author Brian Stansberry
- */
- at Remote
-public interface Ejb3StatelessSession
-{
-   void log(String category);
-}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSession.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,33 @@
+/*
+ * 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.classloader.leak.ejb3;
+
+import javax.ejb.Remote;
+
+/**
+ * @author Brian Stansberry
+ */
+ at Remote
+public interface Ejb3StatelessSession
+{
+   void log(String category);
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java	2007-03-10 07:29:17 UTC (rev 61250)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,50 +0,0 @@
-/*
- * 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.classloader.leak.ejb3;
-
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.ejb.RemoteBinding;
-
-/**
- * @author Brian Stansberry
- */
- at Stateless(name="Ejb3StatelessSession")
- at RemoteBinding(jndiBinding="Ejb3StatelessSession/remote")
- at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
-public class Ejb3StatelessSessionBean implements Ejb3StatelessSession
-{
-   private static final long serialVersionUID = 1L;
-
-   public void log(String category)
-   {
-      Log log = LogFactory.getLog(category);
-      log.info("Logging for " + getClass().getName());  
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB", Ejb3StatelessSessionBean.class.getClassLoader());
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
-   }
-
-}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/Ejb3StatelessSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,50 @@
+/*
+ * 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.classloader.leak.ejb3;
+
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * @author Brian Stansberry
+ */
+ at Stateless(name="Ejb3StatelessSession")
+ at RemoteBinding(jndiBinding="Ejb3StatelessSession/remote")
+ at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
+public class Ejb3StatelessSessionBean implements Ejb3StatelessSession
+{
+   private static final long serialVersionUID = 1L;
+
+   public void log(String category)
+   {
+      Log log = LogFactory.getLog(category);
+      log.info("Logging for " + getClass().getName());  
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB", Ejb3StatelessSessionBean.class.getClassLoader());
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
+   }
+
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java	2007-03-10 07:29:17 UTC (rev 61250)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,54 +0,0 @@
-/*
- * 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.classloader.leak.ejb3;
-
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.ejb.PoolClass;
-import org.jboss.annotation.ejb.RemoteBinding;
-
-/**
- * SLSB that uses ThreadLocalPool.
- * 
- * @author Brian Stansberry
- */
- at Stateless(name="ThreadLocalPoolEjb3StatelessSession")
- at PoolClass(value=org.jboss.ejb3.ThreadlocalPool.class)
- at RemoteBinding(jndiBinding="ThreadLocalPoolEjb3StatelessSession/remote")
- at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
-public class ThreadLocalPoolEjb3StatelessSessionBean implements Ejb3StatelessSession
-{
-   private static final long serialVersionUID = 1L;
-
-   public void log(String category)
-   {
-      Log log = LogFactory.getLog(category);
-      log.info("Logging for " + getClass().getName());    
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_TLP_SLSB", ThreadLocalPoolEjb3StatelessSessionBean.class.getClassLoader());
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_TLP_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
-   }
-
-}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/ejb3/ThreadLocalPoolEjb3StatelessSessionBean.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,54 @@
+/*
+ * 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.classloader.leak.ejb3;
+
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.PoolClass;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * SLSB that uses ThreadLocalPool.
+ * 
+ * @author Brian Stansberry
+ */
+ at Stateless(name="ThreadLocalPoolEjb3StatelessSession")
+ at PoolClass(value=org.jboss.ejb3.ThreadlocalPool.class)
+ at RemoteBinding(jndiBinding="ThreadLocalPoolEjb3StatelessSession/remote")
+ at TransactionAttribute(value=TransactionAttributeType.SUPPORTS)
+public class ThreadLocalPoolEjb3StatelessSessionBean implements Ejb3StatelessSession
+{
+   private static final long serialVersionUID = 1L;
+
+   public void log(String category)
+   {
+      Log log = LogFactory.getLog(category);
+      log.info("Logging for " + getClass().getName());    
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_TLP_SLSB", ThreadLocalPoolEjb3StatelessSessionBean.class.getClassLoader());
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_TLP_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
+   }
+
+}

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,341 @@
+/*
+ * 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.classloader.leak.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.classloader.leak.clstore.ClassLoaderTrackerMBean;
+
+/**
+ * Abstract superclass of the EJB2 and EJB3 versions of the classloader leak
+ * tests.
+ * 
+ * @author Brian Stansberry
+ */
+public abstract class ClassloaderLeakTestBase extends JBossTestCase
+{
+   public static final String WEBAPP = "WEBAPP";
+   public static final String SERVLET = "SERVLET";
+   public static final String SERVLET_TCCL = "SERVLET_TCCL";
+   public static final String JSP = "JSP";
+   public static final String JSP_TCCL = "JSP_TCCL";
+   
+   public static final String[] WEB = new String[]{ WEBAPP, SERVLET, SERVLET_TCCL, JSP, JSP_TCCL };
+   
+   private static final Set<String> deployments = new HashSet<String>();
+   
+   private String baseURL = null;
+
+   public ClassloaderLeakTestBase(String name)
+   {
+      super(name);
+   }
+   
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      cleanDeployments();
+      
+      for (int i = 0; i < WEB.length; i++)
+         removeClassLoader(WEB[i]);
+      
+      String[] ejbs = getEjbKeys();
+      for (int i = 0; i < ejbs.length; i++)
+         removeClassLoader(ejbs[i]);
+      
+      baseURL = "http://" + getServerHost() + ":8080/" + getWarContextPath() + "/";
+   }
+   
+   protected void tearDown() throws Exception
+   {
+      cleanDeployments();
+      
+      for (int i = 0; i < WEB.length; i++)
+         removeClassLoader(WEB[i]);
+      
+      String[] ejbs = getEjbKeys();
+      for (int i = 0; i < ejbs.length; i++)
+         removeClassLoader(ejbs[i]);
+      
+      super.tearDown();
+   }
+   
+   protected abstract String getWarContextPath();
+   
+   protected abstract String[] getEjbKeys();
+   
+   protected void cleanDeployments() throws Exception
+   {
+      Iterator it = deployments.iterator();
+      while (it.hasNext())
+      {
+         undeployComponent((String) it.next(), false);
+         it = deployments.iterator();
+      }
+   }
+   
+   protected void undeployComponent(String deployment, boolean propagateFailure)
+         throws Exception
+   {
+      try
+      {
+         undeploy(deployment);
+         deployments.remove(deployment);
+      }
+      catch (Exception e)
+      {
+         if (propagateFailure)
+            throw e;
+         else
+            log.error("Exception during undeploy of " + deployment, e);
+      }
+   }
+   
+   private void deployComponent(String deployment) throws Exception
+   {
+      deploy(deployment);
+      deployments.add(deployment);
+   }
+   
+   protected void warTest(String deployment) throws Exception
+   {
+      // Ensure we are starting with a clean slate
+      checkCleanKeys(WEB);
+      
+      deployComponent(deployment);      
+
+      makeWebRequest(baseURL + "SimpleServlet", WEBAPP);
+      makeWebRequest(baseURL + "simple.jsp", WEBAPP);
+      
+      // Make sure the expected registrations were done
+      checkKeyRegistration(WEB);
+      
+      // This sleep is a workaround to JBAS-4060
+      sleep(500);
+      
+      undeployComponent(deployment, true);
+      
+      // TODO - probably not needed anymore; remove
+      flushSecurityCache("HsqlDbRealm");
+      
+      sleep(500);
+      
+      // Confirm the classloaders were released
+      String unregistered = checkClassLoaderRelease(WEB);
+      
+      if (unregistered.trim().length() > 0)
+      {
+         fail("Classloaders unregistered: " + unregistered);
+      }
+   }
+   
+   protected void ejbTest(String deployment) throws Exception
+   {
+      // Ensure we are starting with a clean slate
+      checkCleanKeys(getEjbKeys());
+      
+      deployComponent(deployment);
+      
+      makeEjbRequests();
+      
+      // Make sure the expected registrations were done
+      checkKeyRegistration(getEjbKeys());
+      
+      undeployComponent(deployment, true);
+      
+      // TODO - probably not needed anymore; remove
+      flushSecurityCache("HsqlDbRealm");
+      
+      sleep(500);
+      
+      // Confirm the classloaders were released
+      String unregistered = checkClassLoaderRelease(getEjbKeys());
+      
+      if (unregistered.length() > 0)
+      {
+         fail("Classloaders unregistered: " + unregistered);
+      }
+   }
+   
+   protected void earTest(String deployment) throws Exception
+   {
+      // Ensure we are starting with a clean slate
+      checkCleanKeys(WEB);      
+      checkCleanKeys(getEjbKeys());
+      
+      deployComponent(deployment);
+      
+      // Simple web requests
+      makeWebRequest(baseURL + "simple.jsp", WEBAPP);
+      makeWebRequest(baseURL + "SimpleServlet", WEBAPP);
+      
+      // Make sure the expected registrations were done      
+      checkKeyRegistration(WEB);
+      
+      // EJB related requests
+      makeWebRequest(baseURL + "ejb.jsp", "EJB");
+      makeWebRequest(baseURL + "EJBServlet", "EJB");
+      
+      makeEjbRequests();
+      
+      // Make sure the expected registrations were done      
+      checkKeyRegistration(getEjbKeys());
+      
+      // This sleep is a workaround to JBAS-4060
+      sleep(500);
+      
+      undeployComponent(deployment, true);
+      
+      // TODO - probably not needed anymore; remove
+      flushSecurityCache("HsqlDbRealm");
+      
+      sleep(500);
+      
+      // Confirm the classloaders were released
+      String unregistered = checkClassLoaderRelease(WEB);
+      
+      unregistered += checkClassLoaderRelease(getEjbKeys());
+      
+      if (unregistered.trim().length() > 0)
+      {
+         fail("Classloaders unregistered: " + unregistered);
+      }
+   }
+   
+   protected void checkCleanKeys(String[] keys) throws Exception
+   {
+      for (int i = 0; i < keys.length; i++)
+      {
+         if (hasClassLoader(keys[i]))
+            throw new IllegalStateException("Classloader already registered for " + keys[i]);
+      }
+   }
+   
+   protected void checkKeyRegistration(String[] keys) throws Exception
+   {
+      for (int i = 0; i < keys.length; i++)
+      {
+         assertTrue(keys[i] + " classloader registered", hasClassLoader(keys[i]));
+      }
+   }
+   
+   protected String checkClassLoaderRelease(String[] keys) throws Exception
+   {
+      String faillist = "";
+      for (int i = 0; i < keys.length; i++)
+      {
+         if (!hasClassLoaderBeenReleased(keys[i]))
+         {
+            faillist += keys[i] + " ";
+            break; // don't check the others; don't want multiple reports
+         }
+      }
+      
+      return faillist;
+   }
+   
+   private boolean hasClassLoader(String key) throws Exception
+   {
+      MBeanServerConnection adaptor = delegate.getServer();
+      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+      Object[] params = { key };
+      String[] signature = new String[] { String.class.getName() };
+      return ((Boolean) adaptor.invoke(on, "hasClassLoader", params, signature)).booleanValue();
+   }
+   
+   private boolean hasClassLoaderBeenReleased(String key) throws Exception
+   {
+      MBeanServerConnection adaptor = delegate.getServer();
+      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+      Object[] params = { key };
+      String[] signature = new String[] { String.class.getName() };
+      return ((Boolean) adaptor.invoke(on, "hasClassLoaderBeenReleased", params, signature)).booleanValue();
+   }
+   
+   private void removeClassLoader(String key) throws Exception
+   {
+      MBeanServerConnection adaptor = delegate.getServer();
+      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+      Object[] params = { key };
+      String[] signature = new String[] { String.class.getName() };
+      adaptor.invoke(on, "removeClassLoader", params, signature);
+   }
+   
+   private void flushSecurityCache(String domain) throws Exception
+   {
+      log.debug("Flushing security cache " + domain);
+      MBeanServerConnection adaptor = delegate.getServer();
+      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+      Object[] params = { domain };
+      String[] signature = new String[] { String.class.getName() };
+      adaptor.invoke(on, "flushSecurityCache", params, signature);
+   }
+   
+   private void makeWebRequest(String url, String responseContent)
+   {
+      HttpClient client = new HttpClient();
+      GetMethod method = new GetMethod(url);
+      int responseCode = 0;
+      try
+      {
+         responseCode = client.executeMethod(method);
+         
+         assertTrue("Get OK with url: " +url + " responseCode: " +responseCode
+               , responseCode == HttpURLConnection.HTTP_OK);
+         
+         InputStream rs = method.getResponseBodyAsStream();
+         InputStreamReader reader = new InputStreamReader(rs);
+         StringWriter writer = new StringWriter();
+         int c;
+         while ((c = reader.read())  != -1)
+            writer.write(c);
+         
+         String rsp = writer.toString();
+         
+         assertTrue("Response contains " + responseContent, rsp.indexOf(responseContent) >= 0);
+      } 
+      catch (IOException e)
+      {
+         e.printStackTrace();
+         fail("HttpClient executeMethod fails." +e.toString());
+      }
+      finally
+      {
+         method.releaseConnection();
+      }
+   }
+   
+   protected abstract void makeEjbRequests() throws Exception;
+}

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakUnitTestCase.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakUnitTestCase.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -21,22 +21,12 @@
  */
 package org.jboss.test.classloader.leak.test;
 
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
 import javax.naming.InitialContext;
 
 import junit.framework.Test;
 
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.jboss.test.JBossTestCase;
-import org.jboss.test.classloader.leak.clstore.ClassLoaderTrackerMBean;
+import org.jboss.test.classloader.leak.ejb.interfaces.StatefulSession;
+import org.jboss.test.classloader.leak.ejb.interfaces.StatefulSessionHome;
 import org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession;
 import org.jboss.test.classloader.leak.ejb.interfaces.StatelessSessionHome;
 
@@ -49,14 +39,14 @@
  * Commons Logging.  As a result, there are various permutations of the tests
  * that store copies of commons-logging in different locations on the classpath.
  * <p/>
- * If these test are run with JBoss Profiler's jbossAgent (.dll or .so) on the path
+ * If these tests are run with JBoss Profiler's jbossAgent (.dll or .so) on the path
  * and the AS is started with -agentlib:jbossAgent, in case of classloader leakage
  * an extensive report will be logged to the server log, showing the path to root of
  * all references to the classloader.
  * 
  * @author Brian Stansberry
  */
-public class ClassloaderLeakUnitTestCase extends JBossTestCase
+public class ClassloaderLeakUnitTestCase extends ClassloaderLeakTestBase
 {
    private static final String SIMPLE_WAR = "classloader-leak-simple.war";
    private static final String WAR_WITH_JCL = "classloader-leak-in-war.war";
@@ -70,80 +60,33 @@
    private static final String NO_WEB_EAR = "classloader-leak-noweb.ear";
    private static final String ISOLATED_NO_WEB_EAR = "classloader-leak-noweb-isolated.ear";
    
-   private static final String WEBAPP = "WEBAPP";
-   private static final String EJB = "EJB";
+   private static final String EJB2_SLSB = "EJB2_SLSB";
+   private static final String EJB2_SFSB = "EJB2_SFSB";
+   private static final String EJB2_SLSB_TCCL = "EJB2_SLSB_TCCL";
+   private static final String EJB2_SFSB_TCCL = "EJB2_SFSB_TCCL";
    
-   private static final Set deployments = new HashSet();
+   private static final String[] EJB2 = new String[]{ EJB2_SLSB, EJB2_SLSB_TCCL, EJB2_SFSB, EJB2_SFSB_TCCL };
    
-   private String baseURL = null;
-
+   
    public ClassloaderLeakUnitTestCase(String name)
    {
       super(name);
    }
-   
-   protected void setUp() throws Exception
+
+
+   public static Test suite() throws Exception
    {
-      super.setUp();
-      cleanDeployments();
-      
-      removeClassLoader(WEBAPP);
-      removeClassLoader(EJB);
-      
-      baseURL = "http://" + getServerHost() + ":8080/classloader-leak/";
+      return getDeploySetup(ClassloaderLeakUnitTestCase.class, "classloader-leak-test.sar");
    }
    
-   protected void tearDown() throws Exception
-   {
-      cleanDeployments();
-      
-      removeClassLoader(WEBAPP);
-      removeClassLoader(EJB);
-      
-      super.tearDown();
-   }
-   
-   private void cleanDeployments() throws Exception
-   {
-      Iterator it = deployments.iterator();
-      while (it.hasNext())
-      {
-         undeploy((String) it.next(), false);
-         it = deployments.iterator();
-      }
-   }
-   
-   private void undeploy(String deployment, boolean propagateFailure)
-         throws Exception
-   {
-      try
-      {
-         undeploy(deployment);
-         deployments.remove(deployment);
-      }
-      catch (Exception e)
-      {
-         if (propagateFailure)
-            throw e;
-         else
-            log.error("Exception during undeploy of " + deployment, e);
-      }
-   }
-   
-   private void deployJCLUser(String deployment) throws Exception
-   {
-      deploy(deployment);
-      deployments.add(deployment);
-   }
-   
    public void testSimpleWar() throws Exception
    {
-      warTest(SIMPLE_WAR, true);
+      warTest(SIMPLE_WAR);
    }
    
    public void testWarWithJcl() throws Exception
    {
-      warTest(WAR_WITH_JCL, true);
+      warTest(WAR_WITH_JCL);
    }
    
    public void testSimpleEjb() throws Exception
@@ -191,158 +134,24 @@
       earTest(ISOLATED_EAR_WITH_DUAL_JCL);
    }
    
-   private void warTest(String deployment, boolean makeRequest) throws Exception
+   protected String getWarContextPath()
    {
-      if (hasClassLoader(WEBAPP))
-         throw new IllegalStateException("Classloader already registered for " + WEBAPP);
-      
-      deployJCLUser(deployment);
-      
-
-      if (makeRequest)
-      {
-         makeWebRequest(baseURL + "SimpleServlet", WEBAPP);
-         makeWebRequest(baseURL + "simple.jsp", WEBAPP);
-      }
-      
-      assertTrue("WEBAPP classloader registered", hasClassLoader(WEBAPP));
-      
-      undeploy(deployment, true);
-      
-      flushSecurityCache("HsqlDbRealm");
-      
-      sleep(500);
-      
-      assertTrue("WEBAPP classloader unregistered", hasClassLoaderBeenReleased(WEBAPP));
+      return "classloader-leak";
    }
    
-   private void ejbTest(String deployment) throws Exception
+   protected String[] getEjbKeys()
    {
-      if (hasClassLoader(EJB))
-         throw new IllegalStateException("Classloader already registered for " + WEBAPP);
-      
-      deployJCLUser(deployment);
-      
-      makeEjbRequest();
-      
-      assertTrue("EJB classloader registered", hasClassLoader(EJB));
-      
-      undeploy(deployment, true);
-      
-      flushSecurityCache("HsqlDbRealm");
-      
-      sleep(500);
-      
-      assertTrue("WEBAPP classloader unregistered", hasClassLoaderBeenReleased(WEBAPP));
+      return EJB2;
    }
    
-   private void earTest(String deployment) throws Exception
+   protected void makeEjbRequests() throws Exception
    {
-      if (hasClassLoader(WEBAPP))
-         throw new IllegalStateException("Classloader already registered for " + WEBAPP);
-      
-      if (hasClassLoader(EJB))
-         throw new IllegalStateException("Classloader already registered for " + EJB);
-      
-      deployJCLUser(deployment);
-      
-      makeWebRequest(baseURL + "simple.jsp", WEBAPP);
-      makeWebRequest(baseURL + "SimpleServlet", WEBAPP);
-      
-      assertTrue("WEBAPP classloader registered", hasClassLoader(WEBAPP));
-      
-      makeWebRequest(baseURL + "ejb.jsp", EJB);
-      makeWebRequest(baseURL + "EJBServlet", EJB);
-      
-      makeEjbRequest();
-      
-      assertTrue("EJB classloader registered", hasClassLoader(EJB));
-         
-      undeploy(deployment, true);
-      
-      flushSecurityCache("HsqlDbRealm");
-      
-      sleep(500);
-
-      if (!hasClassLoaderBeenReleased(WEBAPP))
-      {
-         if (!hasClassLoaderBeenReleased(EJB))
-            fail("Both EJB and WEBAPP classloaders unregistered");
-         fail("WEBAPP classloader unregistered");
-      }
-      assertTrue("EJB classloader unregistered", hasClassLoaderBeenReleased(EJB));
-      
+      InitialContext ctx = new InitialContext();
+      StatelessSessionHome slsbhome = (StatelessSessionHome) ctx.lookup("ClassloaderLeakStatelessSession");
+      StatelessSession slsbbean = slsbhome.create();
+      slsbbean.log("EJB");
+      StatefulSessionHome sfsbhome = (StatefulSessionHome) ctx.lookup("ClassloaderLeakStatefulSession");
+      StatefulSession sfsbbean = sfsbhome.create();
+      sfsbbean.log("EJB");
    }
-   
-   private boolean hasClassLoader(String key) throws Exception
-   {
-      MBeanServerConnection adaptor = delegate.getServer();
-      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
-      Object[] params = { key };
-      String[] signature = new String[] { String.class.getName() };
-      return ((Boolean) adaptor.invoke(on, "hasClassLoader", params, signature)).booleanValue();
-   }
-   
-   private boolean hasClassLoaderBeenReleased(String key) throws Exception
-   {
-      MBeanServerConnection adaptor = delegate.getServer();
-      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
-      Object[] params = { key };
-      String[] signature = new String[] { String.class.getName() };
-      return ((Boolean) adaptor.invoke(on, "hasClassLoaderBeenReleased", params, signature)).booleanValue();
-   }
-   
-   private void removeClassLoader(String key) throws Exception
-   {
-      MBeanServerConnection adaptor = delegate.getServer();
-      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
-      Object[] params = { key };
-      String[] signature = new String[] { String.class.getName() };
-      adaptor.invoke(on, "removeClassLoader", params, signature);
-   }
-   
-   private void flushSecurityCache(String domain) throws Exception
-   {
-      log.debug("Flushing security cache " + domain);
-      MBeanServerConnection adaptor = delegate.getServer();
-      ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
-      Object[] params = { domain };
-      String[] signature = new String[] { String.class.getName() };
-      adaptor.invoke(on, "flushSecurityCache", params, signature);
-   }
-   
-   private void makeWebRequest(String url, String responseContent)
-   {
-      HttpClient client = new HttpClient();
-      GetMethod method = new GetMethod(url);
-      int responseCode = 0;
-      try
-      {
-         responseCode = client.executeMethod(method);
-         
-         assertTrue("Get OK with url: " +url + " responseCode: " +responseCode
-               , responseCode == HttpURLConnection.HTTP_OK);
-         
-         String rsp = new String(method.getResponseBody());
-         
-         assertTrue("Response contains " + responseContent, rsp.indexOf(responseContent) >= 0);
-      } catch (IOException e)
-      {
-         e.printStackTrace();
-         fail("HttpClient executeMethod fails." +e.toString());
-      }
-   }
-   
-   private void makeEjbRequest() throws Exception
-   {
-      InitialContext ctx = this.getInitialContext();
-      StatelessSessionHome home = (StatelessSessionHome) ctx.lookup("ClassloaderLeakStatelessSession");
-      StatelessSession bean = home.create();
-      bean.log("EJB");
-   }
-
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(ClassloaderLeakUnitTestCase.class, "classloader-leak-test.sar");
-   }
 }

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakUnitTestCase.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakUnitTestCase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakUnitTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakUnitTestCase.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,117 @@
+/*
+ * 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.classloader.leak.test;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSession;
+import org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession;
+
+/**
+ * Similar to {@link ClassloaderLeakUnitTestCase}, but uses EJB3 instead
+ * of EJB2. Doesn't repeat the non-EJB related tests, nor does it go through
+ * all the various permutations of Jakarta Commons Logging packaging.
+ * <p/>
+ * If these tests are run with JBoss Profiler's jbossAgent (.dll or .so) on the path
+ * and the AS is started with -agentlib:jbossAgent, in case of classloader leakage
+ * an extensive report will be logged to the server log, showing the path to root of
+ * all references to the classloader.
+ * 
+ * @author Brian Stansberry
+ */
+public class Ejb3ClassloaderLeakUnitTestCase extends ClassloaderLeakTestBase
+{
+   private static final String SIMPLE_EJB = "classloader-leak-ejb3.jar"; 
+   private static final String SIMPLE_EAR = "classloader-leak-simple-ejb3.ear"; 
+   private static final String SIMPLE_ISOLATED_EAR = "classloader-leak-simple-isolated-ejb3.ear";
+   private static final String NO_WEB_EAR = "classloader-leak-noweb-ejb3.ear";
+   private static final String ISOLATED_NO_WEB_EAR = "classloader-leak-noweb-isolated-ejb3.ear";
+   
+   private static final String EJB3_SLSB = "EJB3_SLSB";
+   private static final String EJB3_SFSB = "EJB3_SFSB";
+   private static final String EJB3_SLSB_TCCL = "EJB3_SLSB_TCCL";
+   private static final String EJB3_SFSB_TCCL = "EJB3_SFSB_TCCL";
+   private static final String EJB3_TLP_SLSB = "EJB3_TLP_SLSB";
+   private static final String EJB3_TLP_SLSB_TCCL = "EJB3_TLP_SLSB_TCCL";
+   
+   private static final String[] EJB3 = new String[]{ EJB3_SLSB, EJB3_SLSB_TCCL, EJB3_SFSB, EJB3_SFSB_TCCL, EJB3_TLP_SLSB, EJB3_TLP_SLSB_TCCL  };
+   
+   
+   public Ejb3ClassloaderLeakUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(Ejb3ClassloaderLeakUnitTestCase.class, "classloader-leak-test.sar");
+   }
+   
+   public void testSimpleEjb() throws Exception
+   {
+      ejbTest(SIMPLE_EJB);
+   }
+   
+   public void testSimpleEar() throws Exception
+   {
+      earTest(SIMPLE_EAR);
+   }
+   
+   public void testNoWebEar() throws Exception
+   {
+      ejbTest(NO_WEB_EAR);
+   }
+   
+   public void testSimpleIsolatedEar() throws Exception
+   {
+      earTest(SIMPLE_ISOLATED_EAR);
+   }
+   
+   public void testIsolatedNoWebEar() throws Exception
+   {
+      ejbTest(ISOLATED_NO_WEB_EAR);
+   }
+   
+   protected String getWarContextPath()
+   {
+      return "classloader-leak-ejb3";
+   }
+   
+   protected String[] getEjbKeys()
+   {
+      return EJB3;
+   }
+   
+   protected void makeEjbRequests() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+      Ejb3StatelessSession ejb3slsb = (Ejb3StatelessSession) ctx.lookup("Ejb3StatelessSession/remote");
+      ejb3slsb.log("EJB");
+      Ejb3StatefulSession ejb3sfsb = (Ejb3StatefulSession) ctx.lookup("Ejb3StatefulSession/remote");
+      ejb3sfsb.log("EJB");
+      Ejb3StatelessSession tlpejb3slsb = (Ejb3StatelessSession) ctx.lookup("ThreadLocalPoolEjb3StatelessSession/remote");
+      tlpejb3slsb.log("EJB");
+   }
+}

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/ClassloaderLeakContextListener.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/ClassloaderLeakContextListener.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/ClassloaderLeakContextListener.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -36,25 +36,25 @@
  */ 
 package org.jboss.test.classloader.leak.web;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
-import org.apache.commons.logging.LogFactory;
-
 public class ClassloaderLeakContextListener implements ServletContextListener
 {
-   private Class[] RELEASE_SIGNATURE = {ClassLoader.class};
+//   private Class[] RELEASE_SIGNATURE = {ClassLoader.class};
+
+   public void contextInitialized(ServletContextEvent arg0)
+   {
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("WEBAPP", ClassloaderLeakContextListener.class.getClassLoader());
+   }
    
    public void contextDestroyed(ServletContextEvent arg0)
    {
-      ClassLoader tccl = Thread.currentThread().getContextClassLoader();
-
-      Object[] params = new Object[1];
-      params[0] = tccl;
-
+//      ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+//
+//      Object[] params = new Object[1];
+//      params[0] = tccl;
+//
       // Walk up the tree of classloaders, finding all the available
       // LogFactory classes and releasing any objects associated with
       // the tccl (ie the webapp).
@@ -121,9 +121,4 @@
 //      LogFactory.release(tccl);
    }
 
-   public void contextInitialized(ServletContextEvent arg0)
-   {
-      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("WEBAPP", ClassloaderLeakContextListener.class.getClassLoader());
-   }
-
 }

Copied: trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/Ejb3Servlet.java (from rev 61250, branches/Branch_4_2/testsuite/src/main/org/jboss/test/classloader/leak/web/Ejb3Servlet.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/Ejb3Servlet.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/Ejb3Servlet.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,68 @@
+/*
+ * 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.classloader.leak.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.naming.InitialContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSession;
+import org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession;
+
+/**
+ * Servlet that invokes on EJB3 Session beans.
+ * 
+ * @author Brian Stansberry
+ */
+public class Ejb3Servlet extends HttpServlet
+{
+   private static final long serialVersionUID = 1L;
+
+   protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+   {
+      try
+      {
+          InitialContext ctx = new InitialContext();
+          Ejb3StatelessSession ejb3slsb = (Ejb3StatelessSession) ctx.lookup("Ejb3StatelessSession/remote");
+          ejb3slsb.log("EJB");
+          Ejb3StatefulSession ejb3sfsb = (Ejb3StatefulSession) ctx.lookup("Ejb3StatefulSession/remote");
+          ejb3sfsb.log("EJB");
+          Ejb3StatelessSession tlpejb3slsb = (Ejb3StatelessSession) ctx.lookup("ThreadLocalPoolEjb3StatelessSession/remote");
+          tlpejb3slsb.log("EJB");
+      }
+      catch (Exception e)
+      {
+          throw new javax.servlet.ServletException(e);
+      }
+      
+      res.setContentType("text/text");
+      PrintWriter writer = res.getWriter();
+      writer.println("EJB");
+      writer.flush();
+   }
+   
+}

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/EjbServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/EjbServlet.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/EjbServlet.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -30,9 +30,16 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.jboss.test.classloader.leak.ejb.interfaces.StatefulSession;
+import org.jboss.test.classloader.leak.ejb.interfaces.StatefulSessionHome;
 import org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession;
 import org.jboss.test.classloader.leak.ejb.interfaces.StatelessSessionHome;
 
+/**
+ * Servlet that invokes on EJB2 Session beans.
+ * 
+ * @author Brian Stansberry
+ */
 public class EjbServlet extends HttpServlet
 {
    private static final long serialVersionUID = 1L;
@@ -42,9 +49,12 @@
       try
       {
           InitialContext ctx = new InitialContext();
-          StatelessSessionHome home = (StatelessSessionHome) ctx.lookup("java:comp/env/ejb/ClassloaderLeakEJB");
-          StatelessSession bean = home.create();
-          bean.log("EJB");
+          StatelessSessionHome slsbhome = (StatelessSessionHome) ctx.lookup("java:comp/env/ejb/ClassloaderLeakEJB2SLSB");
+          StatelessSession slsbbean = slsbhome.create();
+          slsbbean.log("EJB");
+          StatefulSessionHome sfsbhome = (StatefulSessionHome) ctx.lookup("java:comp/env/ejb/ClassloaderLeakEJB2SFSB");
+          StatefulSession sfsbbean = sfsbhome.create();
+          sfsbbean.log("EJB");
       }
       catch (Exception e)
       {

Modified: trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleServlet.java	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleServlet.java	2007-03-12 03:50:16 UTC (rev 61276)
@@ -39,8 +39,11 @@
    protected void doGet(HttpServletRequest req, HttpServletResponse res)
       throws ServletException, IOException
    {
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET", Thread.currentThread().getContextClassLoader());
+      org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET_TCCL", Thread.currentThread().getContextClassLoader());
+      
       Log log = LogFactory.getLog("WEBAPP");
-      log.info("WEBAPP is here");
+      log.info("Logging from " + getClass().getName());
       
       res.setContentType("text/text");
       PrintWriter writer = res.getWriter();

Modified: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-dual.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-dual.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-dual.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -14,8 +14,8 @@
       </web>
     </module>
     <module>
-        <ejb>classloader-leak-ejb.jar</ejb>
+        <ejb>classloader-leak-ejb-jcl.jar</ejb>
     </module>
-
+    
 </application>
 

Copied: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-ejb3.xml (from rev 61250, branches/Branch_4_2/testsuite/src/resources/classloader/leak/ear/META-INF/application-ejb3.xml)
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-ejb3.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-ejb3.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<application version="1.4"
+             xmlns="http://java.sun.com/xml/ns/j2ee" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+                                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+>
+
+   <module>
+      <web>
+         <web-uri>classloader-leak-simple-ejb3.war</web-uri>
+         <context-root>/classloader-leak-ejb3</context-root>
+      </web>
+    </module>
+    <module>
+        <ejb>classloader-leak-ejb3.jar</ejb>
+    </module>
+    
+</application>
+

Added: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-jcl.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-jcl.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-jcl.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<application version="1.4"
+             xmlns="http://java.sun.com/xml/ns/j2ee" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+                                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+>
+
+   <module>
+      <web>
+         <web-uri>classloader-leak-simple-ejb.war</web-uri>
+         <context-root>/classloader-leak</context-root>
+      </web>
+    </module>
+    <module>
+        <ejb>classloader-leak-ejb-jcl.jar</ejb>
+    </module>
+    
+</application>
+

Deleted: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-nolink.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-nolink.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-nolink.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<application version="1.4"
-             xmlns="http://java.sun.com/xml/ns/j2ee" 
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
-                                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
->
-
-   <module>
-      <web>
-         <web-uri>classloader-leak-simple.war</web-uri>
-         <context-root>/classloader-leak</context-root>
-      </web>
-    </module>
-    <module>
-        <ejb>classloader-leak-ejb.jar</ejb>
-    </module>
-
-</application>
-

Copied: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-noweb-ejb3.xml (from rev 61250, branches/Branch_4_2/testsuite/src/resources/classloader/leak/ear/META-INF/application-noweb-ejb3.xml)
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-noweb-ejb3.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application-noweb-ejb3.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<application version="1.4"
+             xmlns="http://java.sun.com/xml/ns/j2ee" 
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+                                 http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+>
+
+   <module>
+       <ejb>classloader-leak-ejb3.jar</ejb>
+   </module>
+
+</application>
+

Modified: trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/ear/META-INF/application.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -16,6 +16,6 @@
     <module>
         <ejb>classloader-leak-ejb.jar</ejb>
     </module>
-
+    
 </application>
 

Modified: trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/MANIFEST.MF
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/MANIFEST.MF	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/MANIFEST.MF	2007-03-12 03:50:16 UTC (rev 61276)
@@ -1,5 +1,4 @@
 Manifest-Version: 1.0
 Ant-Version: Apache Ant 1.6.5
 Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.)
-Class-Path: lib/commons-logging.jar
 

Modified: trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/ejb-jar.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/ejb-jar.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -14,6 +14,15 @@
             <transaction-type>Container</transaction-type>
         </session>
         
+       <session>
+            <ejb-name>ClassloaderLeakStatefulSession</ejb-name>
+            <home>org.jboss.test.classloader.leak.ejb.interfaces.StatefulSessionHome</home>
+            <remote>org.jboss.test.classloader.leak.ejb.interfaces.StatefulSession</remote>
+            <ejb-class>org.jboss.test.classloader.leak.ejb.bean.StatefulSessionBean</ejb-class>
+            <session-type>Stateful</session-type>
+            <transaction-type>Container</transaction-type>
+        </session>
+        
     </enterprise-beans>
     
 </ejb-jar>

Added: trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/jcl/MANIFEST.MF
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/jcl/MANIFEST.MF	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/ejb/META-INF/jcl/MANIFEST.MF	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.6.5
+Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.)
+Class-Path: lib/commons-logging.jar
+

Added: trunk/testsuite/src/resources/classloader/leak/ejb3/META-INF/MANIFEST.MF
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/ejb3/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/ejb3/META-INF/MANIFEST.MF	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.6.5
+Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.)
+

Modified: trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/web.xml	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/web.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -14,29 +14,11 @@
       <servlet-name>SimpleServlet</servlet-name>
       <servlet-class>org.jboss.test.classloader.leak.web.SimpleServlet</servlet-class>
    </servlet>
-   
-   <servlet>
-      <servlet-name>EJBServlet</servlet-name>
-      <servlet-class>org.jboss.test.classloader.leak.web.EjbServlet</servlet-class>
-   </servlet>
 
    <servlet-mapping>
       <servlet-name>SimpleServlet</servlet-name>
       <url-pattern>/SimpleServlet</url-pattern>
    </servlet-mapping>
-
-   <servlet-mapping>
-      <servlet-name>EJBServlet</servlet-name>
-      <url-pattern>/EJBServlet</url-pattern>
-   </servlet-mapping>
-      
-   <ejb-ref>
-       <ejb-ref-name>ejb/ClassloaderLeakEJB</ejb-ref-name>
-       <ejb-ref-type>Session</ejb-ref-type>
-       <home>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSessionHome</home>
-       <remote>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession</remote>
-       <ejb-link>ClassloaderLeakStatelessSession</ejb-link>
-   </ejb-ref>
    
 </web-app>
 

Added: trunk/testsuite/src/resources/classloader/leak/war/ejb2/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/ejb2/WEB-INF/web.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/war/ejb2/WEB-INF/web.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+  <!-- Registers an mbean the test driver can use to check the cache state -->
+  <listener>
+  	<listener-class>org.jboss.test.classloader.leak.web.ClassloaderLeakContextListener</listener-class>
+  </listener>
+
+   <servlet>
+      <servlet-name>SimpleServlet</servlet-name>
+      <servlet-class>org.jboss.test.classloader.leak.web.SimpleServlet</servlet-class>
+   </servlet>
+   
+   <servlet>
+      <servlet-name>EJBServlet</servlet-name>
+      <servlet-class>org.jboss.test.classloader.leak.web.EjbServlet</servlet-class>
+   </servlet>
+
+   <servlet-mapping>
+      <servlet-name>SimpleServlet</servlet-name>
+      <url-pattern>/SimpleServlet</url-pattern>
+   </servlet-mapping>
+
+   <servlet-mapping>
+      <servlet-name>EJBServlet</servlet-name>
+      <url-pattern>/EJBServlet</url-pattern>
+   </servlet-mapping>
+      
+   <ejb-ref>
+       <ejb-ref-name>ejb/ClassloaderLeakEJB2SLSB</ejb-ref-name>
+       <ejb-ref-type>Session</ejb-ref-type>
+       <home>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSessionHome</home>
+       <remote>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession</remote>
+       <ejb-link>ClassloaderLeakStatelessSession</ejb-link>
+   </ejb-ref>
+      
+   <ejb-ref>
+       <ejb-ref-name>ejb/ClassloaderLeakEJB2SFSB</ejb-ref-name>
+       <ejb-ref-type>Session</ejb-ref-type>
+       <home>org.jboss.test.classloader.leak.ejb.interfaces.StatefulSessionHome</home>
+       <remote>org.jboss.test.classloader.leak.ejb.interfaces.StatefulSession</remote>
+       <ejb-link>ClassloaderLeakStatefulSession</ejb-link>
+   </ejb-ref>
+   
+</web-app>
+

Added: trunk/testsuite/src/resources/classloader/leak/war/ejb2/ejb.jsp
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/ejb2/ejb.jsp	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/war/ejb2/ejb.jsp	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,20 @@
+<%@page contentType="text/html"%>
+<%@page import="javax.naming.*"%>
+<%@page import="org.jboss.test.classloader.leak.ejb.interfaces.*"%>
+<%
+  try
+  {
+      InitialContext ctx = new InitialContext();
+      StatelessSessionHome slsbhome = (StatelessSessionHome) ctx.lookup("java:comp/env/ejb/ClassloaderLeakEJB2SLSB");
+      StatelessSession slsbbean = slsbhome.create();
+      slsbbean.log("EJB");
+      StatefulSessionHome sfsbhome = (StatefulSessionHome) ctx.lookup("java:comp/env/ejb/ClassloaderLeakEJB2SFSB");
+      StatefulSession sfsbbean = sfsbhome.create();
+      sfsbbean.log("EJB");
+  }
+  catch (Exception e)
+  {
+      throw new javax.servlet.ServletException(e);
+  }
+%>
+EJB
\ No newline at end of file

Added: trunk/testsuite/src/resources/classloader/leak/war/ejb3/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/ejb3/WEB-INF/web.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/war/ejb3/WEB-INF/web.xml	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+  <!-- Registers an mbean the test driver can use to check the cache state -->
+  <listener>
+  	<listener-class>org.jboss.test.classloader.leak.web.ClassloaderLeakContextListener</listener-class>
+  </listener>
+
+   <servlet>
+      <servlet-name>SimpleServlet</servlet-name>
+      <servlet-class>org.jboss.test.classloader.leak.web.SimpleServlet</servlet-class>
+   </servlet>
+   
+   <servlet>
+      <servlet-name>EJBServlet</servlet-name>
+      <servlet-class>org.jboss.test.classloader.leak.web.Ejb3Servlet</servlet-class>
+   </servlet>
+
+   <servlet-mapping>
+      <servlet-name>SimpleServlet</servlet-name>
+      <url-pattern>/SimpleServlet</url-pattern>
+   </servlet-mapping>
+
+   <servlet-mapping>
+      <servlet-name>EJBServlet</servlet-name>
+      <url-pattern>/EJBServlet</url-pattern>
+   </servlet-mapping>
+   
+   <!-- FIXME: get ENC bindings working -->
+   <!--   
+   <ejb-ref>
+       <ejb-ref-name>ejb/ClassloaderLeakEJB3SLSB</ejb-ref-name>
+       <ejb-ref-type>Session</ejb-ref-type>
+       <home>org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession</home>
+       <remote>org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSession</remote>
+       <ejb-link>Ejb3StatelessSessionBean</ejb-link>
+   </ejb-ref>
+      
+   <ejb-ref>
+       <ejb-ref-name>ejb/ClassloaderLeakEJB3SFSB</ejb-ref-name>
+       <ejb-ref-type>Session</ejb-ref-type>
+       <home>org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSession</home>
+       <remote>org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSession</remote>
+       <ejb-link>Ejb3StatefulSessionBean</ejb-link>
+   </ejb-ref>
+   -->
+</web-app>
+

Added: trunk/testsuite/src/resources/classloader/leak/war/ejb3/ejb.jsp
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/ejb3/ejb.jsp	                        (rev 0)
+++ trunk/testsuite/src/resources/classloader/leak/war/ejb3/ejb.jsp	2007-03-12 03:50:16 UTC (rev 61276)
@@ -0,0 +1,20 @@
+<%@page contentType="text/html"%>
+<%@page import="javax.naming.*"%>
+<%@page import="org.jboss.test.classloader.leak.ejb3.*"%>
+<%
+  try
+  {
+      InitialContext ctx = new InitialContext();
+      Ejb3StatelessSession ejb3slsb = (Ejb3StatelessSession) ctx.lookup("Ejb3StatelessSession/remote");
+      ejb3slsb.log("EJB");
+      Ejb3StatefulSession ejb3sfsb = (Ejb3StatefulSession) ctx.lookup("Ejb3StatefulSession/remote");
+      ejb3sfsb.log("EJB");
+      Ejb3StatelessSession tlpejb3slsb = (Ejb3StatelessSession) ctx.lookup("ThreadLocalPoolEjb3StatelessSession/remote");
+      tlpejb3slsb.log("EJB");
+  }
+  catch (Exception e)
+  {
+      throw new javax.servlet.ServletException(e);
+  }
+%>
+EJB
\ No newline at end of file

Modified: trunk/testsuite/src/resources/classloader/leak/war/simple.jsp
===================================================================
--- trunk/testsuite/src/resources/classloader/leak/war/simple.jsp	2007-03-12 03:24:23 UTC (rev 61275)
+++ trunk/testsuite/src/resources/classloader/leak/war/simple.jsp	2007-03-12 03:50:16 UTC (rev 61276)
@@ -2,7 +2,10 @@
 <%@page import="org.apache.commons.logging.Log"%>
 <%@page import="org.apache.commons.logging.LogFactory"%>
 <%
+  org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("JSP", getClass().getClassLoader());
+  org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("JSP_TCCL", Thread.currentThread().getContextClassLoader());
+  
   Log log = LogFactory.getLog("WEBAPP");
-  log.fatal("WEBAPP is here");
+  log.info("Logging from " + getClass().getName());
 %>
 WEBAPP
\ No newline at end of file




More information about the jboss-cvs-commits mailing list