[jboss-cvs] JBossAS SVN: r71984 - in trunk/testsuite: src/main/org/jboss/test/cluster and 27 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 10 19:34:07 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-04-10 19:34:07 -0400 (Thu, 10 Apr 2008)
New Revision: 71984
Added:
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatefulSessionBean.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatelessSessionBean.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakTestBase.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Address.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Person.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/ReplicableServlet.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/SimpleServlet.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Address.java
trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Person.java
trunk/testsuite/src/resources/cluster/classloader/
trunk/testsuite/src/resources/cluster/classloader/leak/
trunk/testsuite/src/resources/cluster/classloader/leak/ear/
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-ejb3.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb-ejb3.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/jboss-app.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ejb/
trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/MANIFEST.MF
trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/ejb-jar.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/jboss.xml
trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/
trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/META-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/META-INF/MANIFEST.MF
trunk/testsuite/src/resources/cluster/classloader/leak/war/
trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb3/
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb3/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb3/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/jboss-web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml
trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/
trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/
trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/web.xml
Modified:
trunk/testsuite/imports/sections/cluster.xml
Log:
[JBAS-5405] Add classloader leak tests for clustered use cases
Modified: trunk/testsuite/imports/sections/cluster.xml
===================================================================
--- trunk/testsuite/imports/sections/cluster.xml 2008-04-10 22:51:38 UTC (rev 71983)
+++ trunk/testsuite/imports/sections/cluster.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -289,7 +289,7 @@
<classpath path="${build.classes}"/>
<classpath refid="jboss.tomcat.classpath"/>
<src path="${build.classes}"/>
- <include name="org/jboss/test/cluster/web/aop/**"/>
+ <include name="org/jboss/test/cluster/**/web/aop/*"/>
<!--aoppath The needed aop.xml file is picked up from the
jbossweb-cluster.aop jar via jboss.tomcat.classpath -->
</aopc>
@@ -309,10 +309,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/aop/*.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-field">
@@ -335,10 +333,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/aop/*.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-field">
@@ -357,10 +353,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/Person.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-cross-ctx-first">
<include name="*.jsp"/>
@@ -377,10 +371,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/Person.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-cross-ctx-second">
<include name="*.jsp"/>
@@ -397,10 +389,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/Person.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-cross-ctx-third">
<include name="*.jsp"/>
@@ -426,10 +416,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/Person.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-scoped">
@@ -446,10 +434,8 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/cluster/web/Person.class"/>
<include name="org/jboss/test/cluster/web/CacheHelper*"/>
- <include
- name="org/jboss/test/cluster/web/BindingListener.class"/>
- <include
- name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
+ <include name="org/jboss/test/cluster/web/BindingListener.class"/>
+ <include name="org/jboss/test/cluster/web/DeserializationSensor.class"/>
</classes>
<fileset dir="${build.resources}/cluster/http/http-scoped">
@@ -483,6 +469,98 @@
tofile="${build.resources}/jboss-web-test-service.xml"
file="${build.resources}/cluster/http/jboss-web-test-service.xml"
overwrite="true"/>
+
+ <!-- Build clustered classloader leak test archives -->
+
+ <war destfile="${build.lib}/cluster-clleak-simple.war"
+ webxml="${build.resources}/cluster/classloader/leak/war/WEB-INF/web.xml">
+ <webinf dir="${build.resources}/cluster/classloader/leak/war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/*"/>
+ </classes>
+ </war>
+ <war destfile="${build.lib}/cluster-clleak-simple-replicable.war"
+ webxml="${build.resources}/cluster/classloader/leak/war/replicable/WEB-INF/web.xml">
+ <webinf dir="${build.resources}/cluster/classloader/leak/war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/aop/*"/>
+ </classes>
+ </war>
+ <war destfile="${build.lib}/cluster-clleak-field.war"
+ webxml="${build.resources}/cluster/classloader/leak/war/field/WEB-INF/web.xml">
+ <webinf dir="${build.resources}/cluster/classloader/leak/war/field/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/aop/*"/>
+ </classes>
+ </war>
+ <war destfile="${build.lib}/cluster-clleak-field-no-replicable.war"
+ webxml="${build.resources}/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml">
+ <webinf dir="${build.resources}/cluster/classloader/leak/war/field/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/*"/>
+ </classes>
+ </war>
+ <war destfile="${build.lib}/cluster-clleak-simple-ejb.war"
+ webxml="${build.resources}/cluster/classloader/leak/war/ejb2/WEB-INF/web.xml">
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/*"/>
+ <include name="org/jboss/test/cluster/classloader/leak/web/aop/*"/>
+ </classes>
+ </war>
+ <jar destfile="${build.lib}/cluster-clleak-ejb.jar"
+ manifest="${build.resources}/cluster/classloader/leak/ejb/META-INF/MANIFEST.MF">
+ <metainf dir="${build.resources}/cluster/classloader/leak/ejb/META-INF"/>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/ejb/**"/>
+ </fileset>
+ </jar>
+ <ear destfile="${build.lib}/cluster-clleak-simple.ear"
+ appxml="${build.resources}/cluster/classloader/leak/ear/META-INF/application.xml">
+ <fileset dir="${build.lib}">
+ <include name="cluster-clleak-simple-ejb.war"/>
+ <include name="cluster-clleak-ejb.jar"/>
+ </fileset>
+ </ear>
+ <ear destfile="${build.lib}/cluster-clleak-simple-isolated.ear"
+ appxml="${build.resources}/cluster/classloader/leak/ear/META-INF/application.xml">
+ <metainf dir="${build.resources}/cluster/classloader/leak/ear/META-INF">
+ <include name="jboss-app.xml"/>
+ </metainf>
+ <fileset dir="${build.lib}">
+ <include name="cluster-clleak-simple-ejb.war"/>
+ <include name="cluster-clleak-ejb.jar"/>
+ </fileset>
+ </ear>
+ <ear destfile="${build.lib}/cluster-clleak-noweb.ear"
+ appxml="${build.resources}/cluster/classloader/leak/ear/META-INF/application-noweb.xml">
+ <fileset dir="${build.lib}">
+ <include name="cluster-clleak-ejb.jar"/>
+ </fileset>
+ </ear>
+ <ear destfile="${build.lib}/cluster-clleak-noweb-isolated.ear"
+ appxml="${build.resources}/cluster/classloader/leak/ear/META-INF/application-noweb.xml">
+ <metainf dir="${build.resources}/cluster/classloader/leak/ear/META-INF">
+ <include name="jboss-app.xml"/>
+ </metainf>
+ <fileset dir="${build.lib}">
+ <include name="cluster-clleak-ejb.jar"/>
+ </fileset>
+ </ear>
</target>
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatefulSessionBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatefulSessionBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatefulSessionBean.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,37 @@
+/*
+ * 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.cluster.classloader.leak.ejb3;
+
+import org.jboss.ejb3.annotation.Clustered;
+
+/**
+ * A Ejb3StatefulSessionBean.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+ at Clustered
+public class Ejb3StatefulSessionBean extends org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSessionBean
+{
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatelessSessionBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatelessSessionBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/ejb3/Ejb3StatelessSessionBean.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,37 @@
+/*
+ * 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.cluster.classloader.leak.ejb3;
+
+import org.jboss.ejb3.annotation.Clustered;
+
+/**
+ * A Ejb3StatelessSessionBean.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+ at Clustered
+public class Ejb3StatelessSessionBean extends org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSessionBean
+{
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakTestBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakTestBase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakTestBase.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,418 @@
+/*
+ * 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.cluster.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.Cookie;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.jboss.test.JBossClusteredTestCase;
+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 JBossClusteredTestCase
+{
+ 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 };
+
+ 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 = "/" + 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);
+ deployments.remove(deployment);
+ }
+ }
+ }
+
+ 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);
+
+ // 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 + "SimpleServlet", WEBAPP);
+
+ // Make sure the expected registrations were done
+ checkKeyRegistration(WEB);
+
+ // EJB related requests
+ 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
+ {
+ MBeanServerConnection[] adaptors = getAdaptors();
+ for (MBeanServerConnection adaptor : adaptors)
+ {
+ for (int i = 0; i < keys.length; i++)
+ {
+ if (hasClassLoader(keys[i], adaptor))
+ throw new IllegalStateException("Classloader already registered for " + keys[i]);
+ }
+ }
+ }
+
+ protected void checkKeyRegistration(String[] keys) throws Exception
+ {
+ MBeanServerConnection[] adaptors = getAdaptors();
+ int nodeNum = 0;
+ for (MBeanServerConnection adaptor : adaptors)
+ {
+ for (int i = 0; i < keys.length; i++)
+ {
+ assertTrue(keys[i] + " classloader registered with node " + nodeNum, hasClassLoader(keys[i], adaptor));
+ }
+ nodeNum++;
+ }
+ }
+
+ protected String checkClassLoaderRelease(String[] keys) throws Exception
+ {
+ String faillist = "";
+ MBeanServerConnection[] adaptors = getAdaptors();
+ int nodeNum = 0;
+ for (MBeanServerConnection adaptor : adaptors)
+ {
+ for (int i = 0; i < keys.length; i++)
+ {
+ if (!hasClassLoaderBeenReleased(keys[i], adaptor))
+ {
+ faillist += "node" + nodeNum + "/" + keys[i] + " ";
+ return faillist; // don't check the others; don't want multiple reports
+ }
+ }
+
+ nodeNum++;
+ }
+
+ return faillist;
+ }
+
+ private boolean hasClassLoader(String key, MBeanServerConnection adaptor) throws Exception
+ {
+ 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, MBeanServerConnection adaptor) throws Exception
+ {
+ 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
+ {
+ try
+ {
+ ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+ Object[] params = { key };
+ String[] signature = new String[] { String.class.getName() };
+ MBeanServerConnection[] adaptors = getAdaptors();
+ for (MBeanServerConnection adaptor : adaptors)
+ {
+ adaptor.invoke(on, "removeClassLoader", params, signature);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Caught exception removing classloader under key " + key, e);
+ }
+ }
+
+ private void flushSecurityCache(String domain) throws Exception
+ {
+ log.debug("Flushing security cache " + domain);
+ ObjectName on = new ObjectName(ClassLoaderTrackerMBean.OBJECT_NAME);
+ Object[] params = { domain };
+ String[] signature = new String[] { String.class.getName() };
+ MBeanServerConnection[] adaptors = getAdaptors();
+ for (MBeanServerConnection adaptor : adaptors)
+ {
+ adaptor.invoke(on, "flushSecurityCache", params, signature);
+ }
+ }
+
+ private void makeWebRequest(String url, String responseContent) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ GetMethod method = new GetMethod(getHttpURLs()[0] + url);
+ checkWebRequest(client, method, url, responseContent);
+
+ setCookieDomainToThisServer(client, getHttpURLs()[1]);
+ method = new GetMethod(getHttpURLs()[1] + url);
+ checkWebRequest(client, method, url, responseContent);
+ }
+
+ private void setCookieDomainToThisServer(HttpClient client, String server)
+ {
+ // Get the session cookie
+ Cookie sessionID = getSessionCookie(client, server);
+ // Reset the domain so that the cookie will be sent to server1
+ sessionID.setDomain(server);
+ client.getState().addCookie(sessionID);
+ }
+
+ protected Cookie getSessionCookie(HttpClient client, String server)
+ {
+ // Get the state for the JSESSIONID
+ HttpState state = client.getState();
+ // Get the JSESSIONID so we can reset the host
+ Cookie[] cookies = state.getCookies();
+ Cookie sessionID = null;
+ for(int c = 0; c < cookies.length; c ++)
+ {
+ Cookie k = cookies[c];
+ if( k.getName().equalsIgnoreCase("JSESSIONID") )
+ sessionID = k;
+ }
+ if(sessionID == null)
+ {
+ fail("setCookieDomainToThisServer(): fail to find session id. Server name: " +server);
+ }
+ log.info("Saw JSESSIONID="+sessionID);
+ return sessionID;
+ }
+
+ /**
+ * FIXME Comment this
+ *
+ * @param client
+ * @param method
+ * @param url
+ * @param responseContent
+ */
+ private void checkWebRequest(HttpClient client, GetMethod method, String url, String responseContent)
+ {
+ 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;
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/ClassloaderLeakUnitTestCase.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,141 @@
+/*
+ * 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.cluster.classloader.leak.test;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+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;
+
+/**
+ * Test for classloader leaks following deployment, use and undeployment
+ * of various packages (wars, ejb jars and ears with and without scoped
+ * classloaders).
+ * <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 ClassloaderLeakUnitTestCase extends ClassloaderLeakTestBase
+{
+ private static final String SIMPLE_WAR = "cluster-clleak-simple.war";
+ private static final String SIMPLE_REPLICABLE_WAR = "cluster-clleak-simple-replicable.war";
+ private static final String FIELD_WAR = "cluster-clleak-field.war";
+ private static final String FIELD_NO_REPLICABLE_WAR = "cluster-clleak-field-no-replicable.war";
+ private static final String SIMPLE_EJB = "cluster-clleak-ejb.jar";
+ private static final String SIMPLE_EAR = "cluster clleak-simple.ear";
+ private static final String SIMPLE_ISOLATED_EAR = "cluster-clleak-simple-isolated.ear";
+ private static final String NO_WEB_EAR = "cluster-clleak-noweb.ear";
+ private static final String ISOLATED_NO_WEB_EAR = "cluster-clleak-noweb-isolated.ear";
+
+ 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 String[] EJB2 = new String[]{ EJB2_SLSB, EJB2_SLSB_TCCL, EJB2_SFSB, EJB2_SFSB_TCCL };
+
+
+ public ClassloaderLeakUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(ClassloaderLeakUnitTestCase.class, "classloader-leak-test.sar");
+ }
+
+ public void testSimpleWar() throws Exception
+ {
+ warTest(SIMPLE_WAR);
+ }
+
+ public void testSimpleReplicableWar() throws Exception
+ {
+ warTest(SIMPLE_REPLICABLE_WAR);
+ }
+
+ public void testFieldWar() throws Exception
+ {
+ warTest(FIELD_WAR);
+ }
+
+ public void testFieldNoReplicableWar() throws Exception
+ {
+ warTest(FIELD_NO_REPLICABLE_WAR);
+ }
+
+// 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 "clustered-clleak";
+ }
+
+ protected String[] getEjbKeys()
+ {
+ return EJB2;
+ }
+
+ protected void makeEjbRequests() throws Exception
+ {
+ 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");
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Address.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Address.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Address.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.classloader.leak.web;
+
+import java.io.Serializable;
+
+
+
+/**
+ * Test class for PojoCache.
+ * Person is a POJO that will be instrumented with CacheInterceptor
+ *
+ * @version $Revision: 59573 $
+ */
+public class Address implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4782007386315375402L;
+
+ String street = null;
+ String city = null;
+ int zip = 0;
+
+ public String getStreet()
+ {
+ return street;
+ }
+
+ public void setStreet(String street)
+ {
+ this.street = street;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public int getZip()
+ {
+ return zip;
+ }
+
+ public void setZip(int zip)
+ {
+ this.zip = zip;
+ }
+
+ public String toString()
+ {
+ return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
+ }
+
+// public Object writeReplace() {
+// return this;
+// }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Address.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Person.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Person.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Person.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.classloader.leak.web;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * Test class for PojoCache.
+ * Person is a POJO that will be instrumented with CacheInterceptor
+ *
+ * @version $Revision: 59573 $
+ */
+public class Person implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5484997974711804156L;
+
+ String name = null;
+ int age = 0;
+ Map hobbies = null;
+ Address address = null;
+ Set skills;
+ List languages;
+ // Test for transient field non-replication
+ transient String currentStatus = "Active";
+ // Test swapping out the Collection ref with proxy one
+ // medication will be different when age limit is exceeded.
+ List medication = null;
+ static final int AGE1 = 50;
+ static final int AGE2 = 60;
+
+ public Person() {
+
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setCurrentStatus(String status) {
+ currentStatus = status;
+ }
+
+ public String getCurrentStatus() {
+ return currentStatus;
+ }
+
+ public void setName(Object obj)
+ {
+ this.name = (String)obj;
+ }
+
+ public int getAge()
+ {
+ return age;
+ }
+
+ public void setAge(int age)
+ {
+
+ this.age = age;
+
+ // This will swap out the reference dynamically
+ if(age < AGE1) {
+ if(medication != null) {
+ medication.clear();
+ medication=null;
+ }
+ }
+ else {
+ if( age >= AGE1 ) {
+ addMedication("Lipitor");
+ }
+
+ if (age >= AGE2) {
+ addMedication("Vioxx");
+ }
+ }
+
+
+ }
+
+ void addMedication(String name) {
+ if( medication == null )
+ medication = new ArrayList();
+ if(!medication.contains(name))
+ medication.add(name);
+ }
+
+ public Map getHobbies()
+ {
+ return hobbies;
+ }
+
+ public void setHobbies(Map hobbies)
+ {
+ this.hobbies = hobbies;
+ }
+
+ public Address getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress(Address address)
+ {
+ this.address = address;
+ }
+
+ public Set getSkills()
+ {
+ return skills;
+ }
+
+ public void setSkills(Set skills)
+ {
+ this.skills = skills;
+ }
+
+ public List getMedication()
+ {
+ return medication;
+ }
+
+ public void setMedication(List medication)
+ {
+ this.medication = medication;
+ }
+
+ public List getLanguages()
+ {
+ return languages;
+ }
+
+ public void setLanguages(List languages)
+ {
+ this.languages = languages;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append("name=").append(getName()).append(", age=").append(getAge()).append(", hobbies=")
+ .append(print(getHobbies())).append(", address=").append(getAddress()).append(", skills=")
+ .append(skills).append(", languages=").append(languages).toString();
+ if(medication != null)
+ sb.append(", medication=" + medication);
+ return sb.toString();
+ }
+
+ public String print(Map m)
+ {
+ StringBuffer sb = new StringBuffer();
+ Map.Entry entry;
+ if (m != null) {
+ for (Iterator it = m.entrySet().iterator(); it.hasNext();) {
+ entry = (Map.Entry) it.next();
+ sb.append(entry.getKey()).append(": ").append(entry.getValue());
+ sb.append("\n");
+ }
+ }
+ return sb.toString();
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/Person.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/ReplicableServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/ReplicableServlet.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/ReplicableServlet.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,75 @@
+/*
+ * 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.cluster.classloader.leak.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.test.cluster.classloader.leak.web.aop.Address;
+import org.jboss.test.cluster.classloader.leak.web.aop.Person;
+
+public class ReplicableServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ 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("Logging from " + getClass().getName());
+
+ HttpSession session = req.getSession();
+ Person ben = (Person) session.getAttribute("TEST_PERSON");
+ if (ben == null)
+ {
+ ben=new Person();
+ Address addr = new Address();
+ addr.setZip(95123);
+ addr.setCity("San Jose");
+ ben.setAge(100);
+ ben.setName("Ben");
+ ben.setAddress(addr);
+ session.setAttribute("TEST_PERSON", ben);
+ }
+ else
+ {
+ ben.setAge(ben.getAge() + 1);
+ }
+
+ res.setContentType("text/text");
+ PrintWriter writer = res.getWriter();
+ writer.println("WEBAPP");
+ writer.flush();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/SimpleServlet.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/SimpleServlet.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/SimpleServlet.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,75 @@
+/*
+ * 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.cluster.classloader.leak.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.test.cluster.classloader.leak.web.Address;
+import org.jboss.test.cluster.classloader.leak.web.Person;
+
+public class SimpleServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ 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("Logging from " + getClass().getName());
+
+ HttpSession session = req.getSession();
+ Person ben = (Person) session.getAttribute("TEST_PERSON");
+ if (ben == null)
+ {
+ ben=new Person();
+ Address addr = new Address();
+ addr.setZip(95123);
+ addr.setCity("San Jose");
+ ben.setAge(100);
+ ben.setName("Ben");
+ ben.setAddress(addr);
+ session.setAttribute("TEST_PERSON", ben);
+ }
+ else
+ {
+ ben.setAge(ben.getAge() + 1);
+ }
+
+ res.setContentType("text/text");
+ PrintWriter writer = res.getWriter();
+ writer.println("WEBAPP");
+ writer.flush();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Address.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Address.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Address.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.classloader.leak.web.aop;
+
+import java.io.Serializable;
+
+import org.jboss.cache.pojo.annotation.Replicable;
+
+
+
+/**
+ * Test class for PojoCache.
+ * Person is a POJO that will be instrumented with CacheInterceptor
+ *
+ * @version $Revision: 59573 $
+ */
+ at Replicable
+public class Address implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4782007386315375402L;
+
+ String street = null;
+ String city = null;
+ int zip = 0;
+
+ public String getStreet()
+ {
+ return street;
+ }
+
+ public void setStreet(String street)
+ {
+ this.street = street;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ public int getZip()
+ {
+ return zip;
+ }
+
+ public void setZip(int zip)
+ {
+ this.zip = zip;
+ }
+
+ public String toString()
+ {
+ return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
+ }
+
+// public Object writeReplace() {
+// return this;
+// }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Address.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Person.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Person.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Person.java 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.classloader.leak.web.aop;
+
+import java.io.Serializable;
+import java.util.*;
+
+import org.jboss.cache.pojo.annotation.Replicable;
+
+
+/**
+ * Test class for PojoCache.
+ * Person is a POJO that will be instrumented with CacheInterceptor
+ *
+ * @version $Revision: 59573 $
+ */
+ at Replicable
+public class Person implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5484997974711804156L;
+
+ String name = null;
+ int age = 0;
+ Map hobbies = null;
+ Address address = null;
+ Set skills;
+ List languages;
+ // Test for transient field non-replication
+ transient String currentStatus = "Active";
+ // Test swapping out the Collection ref with proxy one
+ // medication will be different when age limit is exceeded.
+ List medication = null;
+ static final int AGE1 = 50;
+ static final int AGE2 = 60;
+
+ public Person() {
+
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setCurrentStatus(String status) {
+ currentStatus = status;
+ }
+
+ public String getCurrentStatus() {
+ return currentStatus;
+ }
+
+ public void setName(Object obj)
+ {
+ this.name = (String)obj;
+ }
+
+ public int getAge()
+ {
+ return age;
+ }
+
+ public void setAge(int age)
+ {
+
+ this.age = age;
+
+ // This will swap out the reference dynamically
+ if(age < AGE1) {
+ if(medication != null) {
+ medication.clear();
+ medication=null;
+ }
+ }
+ else {
+ if( age >= AGE1 ) {
+ addMedication("Lipitor");
+ }
+
+ if (age >= AGE2) {
+ addMedication("Vioxx");
+ }
+ }
+
+
+ }
+
+ void addMedication(String name) {
+ if( medication == null )
+ medication = new ArrayList();
+ if(!medication.contains(name))
+ medication.add(name);
+ }
+
+ public Map getHobbies()
+ {
+ return hobbies;
+ }
+
+ public void setHobbies(Map hobbies)
+ {
+ this.hobbies = hobbies;
+ }
+
+ public Address getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress(Address address)
+ {
+ this.address = address;
+ }
+
+ public Set getSkills()
+ {
+ return skills;
+ }
+
+ public void setSkills(Set skills)
+ {
+ this.skills = skills;
+ }
+
+ public List getMedication()
+ {
+ return medication;
+ }
+
+ public void setMedication(List medication)
+ {
+ this.medication = medication;
+ }
+
+ public List getLanguages()
+ {
+ return languages;
+ }
+
+ public void setLanguages(List languages)
+ {
+ this.languages = languages;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append("name=").append(getName()).append(", age=").append(getAge()).append(", hobbies=")
+ .append(print(getHobbies())).append(", address=").append(getAddress()).append(", skills=")
+ .append(skills).append(", languages=").append(languages).toString();
+ if(medication != null)
+ sb.append(", medication=" + medication);
+ return sb.toString();
+ }
+
+ public String print(Map m)
+ {
+ StringBuffer sb = new StringBuffer();
+ Map.Entry entry;
+ if (m != null) {
+ for (Iterator it = m.entrySet().iterator(); it.hasNext();) {
+ entry = (Map.Entry) it.next();
+ sb.append(entry.getKey()).append(": ").append(entry.getValue());
+ sb.append("\n");
+ }
+ }
+ return sb.toString();
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/cluster/classloader/leak/web/aop/Person.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-ejb3.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-ejb3.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-ejb3.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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>cluster-clleak-simple-ejb3.war</web-uri>
+ <context-root>/clustered-clleak-ejb3</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>cluster-clleak-ejb3.jar</ejb>
+ </module>
+
+</application>
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb-ejb3.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb-ejb3.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb-ejb3.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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>cluster-clleak-ejb3.jar</ejb>
+ </module>
+
+</application>
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application-noweb.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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>cluster-clleak-ejb.jar</ejb>
+ </module>
+
+</application>
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/application.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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>cluster-clleak-simple-ejb.war</web-uri>
+ <context-root>/clustered-clleak</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>cluster-clleak-ejb.jar</ejb>
+ </module>
+
+</application>
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/jboss-app.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ear/META-INF/jboss-app.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd"
+>
+
+<jboss-app>
+
+ <loader-repository>jboss.test:loader=cluster-clleak-isolated.ear
+ <loader-repository-config>
+ java2ParentDelegation=false
+ </loader-repository-config>
+ </loader-repository>
+
+</jboss-app>
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/MANIFEST.MF
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/MANIFEST.MF (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/MANIFEST.MF 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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.)
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/ejb-jar.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/ejb-jar.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+ "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+<ejb-jar>
+
+ <enterprise-beans>
+
+ <session>
+ <ejb-name>ClassloaderLeakStatelessSession</ejb-name>
+ <home>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSessionHome</home>
+ <remote>org.jboss.test.classloader.leak.ejb.interfaces.StatelessSession</remote>
+ <ejb-class>org.jboss.test.classloader.leak.ejb.bean.StatelessSessionBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <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/cluster/classloader/leak/ejb/META-INF/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/jboss.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ejb/META-INF/jboss.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss PUBLIC
+ "-//JBoss//DTD JBOSS 3.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
+
+<jboss>
+
+ <enterprise-beans>
+ <session>
+ <ejb-name>ClassloaderLeakStatelessSession</ejb-name>
+ <clustered>true</clustered>
+ </session>
+ <session>
+ <ejb-name>ClassloaderLeakStatefulSession</ejb-name>
+ <clustered>true</clustered>
+ </session>
+ </enterprise-beans>
+
+</jboss>
Added: trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/META-INF/MANIFEST.MF
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/META-INF/MANIFEST.MF (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/ejb3/META-INF/MANIFEST.MF 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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.)
+
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/jboss-web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/jboss-web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,28 @@
+ <!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
+
+<jboss-web>
+<!--
+ <class-loading>
+ <loader-repository>jboss.web:loader=testHA</loader-repository>
+ </class-loading>
+-->
+
+ <!-- To avoid a custom config, use the jmx-console security domain -->
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+ <context-root>/clustered-clleak</context-root>
+
+ <replication-config>
+ <replication-granularity>SESSION</replication-granularity>
+ <replication-field-batch-mode>TRUE</replication-field-batch-mode>
+ </replication-config>
+ <max-active-sessions>20</max-active-sessions>
+ <passivation-config>
+ <use-session-passivation>true</use-session-passivation>
+ <passivation-min-idle-time>5</passivation-min-idle-time>
+ <passivation-max-idle-time>10</passivation-max-idle-time>
+ </passivation-config>
+
+</jboss-web>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!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>
+
+ <distributable/>
+
+ <!-- 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.cluster.classloader.leak.web.SimpleServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SimpleServlet</servlet-name>
+ <url-pattern>/SimpleServlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb2/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -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>
+
+ <distributable/>
+
+ <!-- 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.cluster.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/cluster/classloader/leak/war/ejb3/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb3/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/ejb3/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,54 @@
+<?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>
+
+ <distributable/>
+
+ <!-- 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/cluster/classloader/leak/war/field/WEB-INF/jboss-web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/jboss-web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/jboss-web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,27 @@
+ <!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
+
+<jboss-web>
+<!--
+ <class-loading>
+ <loader-repository>jboss.web:loader=testHA</loader-repository>
+ </class-loading>
+-->
+ <!-- To avoid a custom config, use the jmx-console security domain -->
+ <security-domain>java:/jaas/jmx-console</security-domain>
+
+ <context-root>/clustered-clleak</context-root>
+
+ <replication-config>
+ <replication-granularity>FIELD</replication-granularity>
+ <replication-field-batch-mode>TRUE</replication-field-batch-mode>
+ </replication-config>
+ <max-active-sessions>20</max-active-sessions>
+ <passivation-config>
+ <use-session-passivation>true</use-session-passivation>
+ <passivation-min-idle-time>5</passivation-min-idle-time>
+ <passivation-max-idle-time>10</passivation-max-idle-time>
+ </passivation-config>
+
+</jboss-web>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!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>
+
+ <distributable/>
+
+ <!-- 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>ReplicableServlet</servlet-name>
+ <servlet-class>org.jboss.test.cluster.classloader.leak.web.ReplicableServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ReplicableServlet</servlet-name>
+ <url-pattern>/SimpleServlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/field/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!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>
+
+ <distributable/>
+
+ <!-- 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.cluster.classloader.leak.web.SimpleServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SimpleServlet</servlet-name>
+ <url-pattern>/SimpleServlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/field/noreplicable/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/web.xml 2008-04-10 23:34:07 UTC (rev 71984)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!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>
+
+ <distributable/>
+
+ <!-- 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>ReplicableServlet</servlet-name>
+ <servlet-class>org.jboss.test.cluster.classloader.leak.web.ReplicableServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ReplicableServlet</servlet-name>
+ <url-pattern>/SimpleServlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: trunk/testsuite/src/resources/cluster/classloader/leak/war/replicable/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
More information about the jboss-cvs-commits
mailing list