[jboss-cvs] JBossAS SVN: r64666 - in branches/Branch_4_2/ejb3: src/resources/test-configs and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 17 15:23:24 EDT 2007


Author: bdecoste
Date: 2007-08-17 15:23:23 -0400 (Fri, 17 Aug 2007)
New Revision: 64666

Added:
   branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/
   branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/
   branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/
   branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/META-INF/
   branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/META-INF/jboss-service.xml
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyRemote.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyStatelessBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/unit/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/unit/MetricsUnitTestCase.java
Modified:
   branches/Branch_4_2/ejb3/build-test.xml
Log:
[EJBTHREE-1031] test for runaway SLSB creation

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-08-17 19:12:10 UTC (rev 64665)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-08-17 19:23:23 UTC (rev 64666)
@@ -2812,6 +2812,21 @@
 	  <copy file="${build.lib}/stateless-test.jar" tofile="${build.lib}/stateless-test.ejb3"/>
    </target>
    
+   <target name="statelesscreation"
+      description="Builds all jar files."
+      depends="compile-classes">
+
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/statelesscreation-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/statelesscreation/*.class"/>
+         </fileset>
+      </jar>
+   	
+	  <copy file="${build.lib}/stateless-test.jar" tofile="${build.lib}/stateless-test.ejb3"/>
+   </target>
+   
    <target name="defaultremotebindings"
       description="Builds all jar files."
       depends="compile-classes">
@@ -3325,7 +3340,7 @@
 	  </copy>
    </target>
    
-   <target name="jars" depends="defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
+   <target name="jars" depends="statelesscreation, defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree832, ejbthree921,
       ejbthree959, ejbthree963, ejbthree994, ejbthree1023, ejbthree1025,
@@ -3609,6 +3624,7 @@
       <antcall target="arjuna-test"  inheritRefs="true"/>
       <antcall target="libdeployment-test"  inheritRefs="true"/>
       <antcall target="multi-instance-localfromremote-test"  inheritRefs="true"/>
+      <antcall target="statelesscreation-test"  inheritRefs="true"/>
    </target>
 
    <target name="no-start-jboss-tests" depends="init" description="Execute all tests">
@@ -4192,6 +4208,36 @@
 
    </target>
    
+   <target name="statelesscreation-test">
+      <create-config baseconf="all" newconf="statelesscreation">
+         <patternset>
+	        <include name="conf/**"/>
+	        <include name="deploy*/**"/>
+	        <include name="lib/**"/>
+         </patternset>
+      </create-config>
+       
+      <start-jboss conf="statelesscreation" host="${node0}" jvmargs="${ejb3.jboss.jvmargs}"/>
+	  
+	  <echo message="Waiting for nodes to start..."/>
+      <waitfor maxwait="120" maxwaitunit="second"
+         checkevery="5" checkeveryunit="second" timeoutproperty="cluster.timeout">
+         <and>
+            <http url="${node0.http.url}"/>
+            <http url="${node0.http.port1.url}"/>
+         </and>
+      </waitfor>
+      <fail message="Timeout waiting for node to start" if="cluster.timeout"/>
+      <echo message="Node has started, waiting to stablize..."/>
+	
+	  <antcall target="test-with-jvmargs" inheritRefs="true">
+         <param name="test" value="statelesscreation"/>
+         <param name="jvmargs" value=""/>
+      </antcall>
+      
+      <stop-jboss url="${node0.jndi.url}" jboss.dist="${ejb3.dist}"/>
+   </target>
+   
    <target name="multi-instance-localfromremote-test">
       <create-config baseconf="default" newconf="localfromremote1">
          <patternset>

Added: branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/META-INF/jboss-service.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/META-INF/jboss-service.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test-configs/statelesscreation/deploy/ejb3.deployer/META-INF/jboss-service.xml	2007-08-17 19:23:23 UTC (rev 64666)
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   JBoss EJB3Deployer
+   
+   $Id: jboss-service.xml 63100 2007-05-16 18:02:32Z bdecoste $
+-->
+<server>
+
+   <!--mbean code="org.jboss.remoting.transport.Connector"
+          name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute>
+      <attribute name="Configuration">
+         <handlers>
+            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+         </handlers>
+      </attribute>
+   </mbean-->
+   
+   <!-- The following is sample configuration for modifying the Connector -->
+   <mbean code="org.jboss.remoting.transport.Connector"
+          name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <attribute name="Configuration">
+         <config>
+            <invoker transport="socket">
+               <attribute name="numAcceptThreads">1</attribute>
+               <attribute name="maxPoolSize">30</attribute>
+               <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+               <attribute name="timeout" isParam="true">60000</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">3873</attribute>
+               <attribute name="backlog">200</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+            </handlers>
+         </config>
+      </attribute>
+   </mbean>
+
+   <mbean code="org.jboss.ejb3.JarsIgnoredForScanning" name="jboss.ejb3:service=JarsIgnoredForScanning">
+      <attribute name="IgnoredJars">
+         snmp-adaptor.jar,
+         otherimages.jar,
+         applet.jar,
+         jcommon.jar,
+         console-mgr-classes.jar,
+         jfreechart.jar,
+         juddi-service.jar,
+         wsdl4j.jar,
+         commons-collections.jar,
+         commons-pool.jar,
+         juddi.jar,
+         commons-discovery.jar,
+         uddi4j.jar,
+         axis.jar,
+         commons-dbcp.jar,
+         jboss-juddiaxis.jar,
+         trove.jar,
+         javassist.jar,
+         jboss-aop-jdk50.jar,
+         jboss-aspect-library-jdk50.jar,
+         ejb3-persistence.jar,
+         commons-validator-1.1.3.jar,
+         commons-collections.jar,
+         commons-fileupload.jar,
+         commons-pool.jar,
+         hibernate-entitymanager.jar,
+         jboss-ejb3x.jar,
+         commons-digester-1.6.jar,
+         cglib-2.1.1.jar,
+         commons-discovery.jar,
+         jboss-annotations-ejb3.jar,
+         jaxen-1.1-beta-4.jar,
+         hibernate-annotations.jar,
+         commons-httpclient.jar,
+         commons-logging.jar,
+         commons-vfs.jar,
+         hibernate3.jar,
+         commons-logging-api.jar,
+         asm.jar,
+         asm-attrs.jar,
+         commons-lang-2.0.jar,
+         commons-beanutils.jar,
+         jboss-ejb3.jar,
+         dom4j.jar,
+         commons-codec-1.2.jar,
+         wsdl4j.jar,
+         xmlsec.jar,
+         jbossws.jar,
+         jboss-bean-deployer.jar,
+         jboss-microcontainer.jar,
+         jboss-dependency.jar,
+         jboss-container.jar,
+         tomcat-coyote.jar,
+         commons-collections.jar,
+         myfaces.jar,
+         jstl.jar,
+         commons-digester-1.6.jar,
+         myfaces-impl.jar,
+         commons-beanutils.jar,
+         myfaces-jsf-api.jar,
+         commons-codec-1.2.jar,
+         catalina-optional.jar,
+         tomcat-util.jar,
+         jasper-compiler.jar,
+         commons-el.jar,
+         jasper-compiler-jdt.jar,
+         tomcat-http.jar,
+         catalina-manager.jar,
+         jasper-runtime.jar,
+         tomcat55-service.jar,
+         servlets-invoker.jar,
+         catalina.jar,
+         naming-resources.jar,
+         servlets-default.jar,
+         tomcat-ajp.jar,
+         commons-modeler.jar,
+         tomcat-apr.jar,
+         servlets-webdav.jar
+      </attribute>
+   </mbean>
+
+   <mbean code="org.jboss.ejb3.EJB3Deployer" name="jboss.ejb3:service=EJB3Deployer" xmbean-dd="">
+
+      <attribute name="DeployEjb3ExtensionOnly">false</attribute>
+
+      <!-- Inline XMBean Descriptor BEGIN -->
+      <xmbean>
+         <description>The EJB3Deployer responsible for ejb3 deployment</description>
+         <descriptors>
+            <interceptors>
+               <!-- comment out DynamicInterceptor to disable dynamic addition of interceptors -->
+               <interceptor code="org.jboss.mx.interceptor.DynamicInterceptor"/>
+            </interceptors>
+         </descriptors>
+         <class>org.jboss.ejb3.EJB3Deployer</class>
+
+         <!-- ServiceMBean attributes -->
+         <attribute access="read-only" getMethod="getName">
+            <description>The class name of the MBean</description>
+            <name>Name</name>
+            <type>java.lang.String</type>
+         </attribute>
+
+         <attribute access="read-only" getMethod="getState">
+            <description>The status of the MBean</description>
+            <name>State</name>
+            <type>int</type>
+         </attribute>
+
+         <attribute access="read-only" getMethod="getStateString">
+            <description>The status of the MBean in text form</description>
+            <name>StateString</name>
+            <type>java.lang.String</type>
+         </attribute>
+
+         <!-- SubDeployerMBean attributes -->
+         <attribute access="read-only" getMethod="getServiceName">
+            <description>The ObjectName of the Subdeployer</description>
+            <name>ServiceName</name>
+            <type>javax.management.ObjectName</type>
+         </attribute>
+
+         <attribute access="read-write" getMethod="getSuffixes" setMethod="setSuffixes">
+            <description>The suffixes of interest to this deployer</description>
+            <name>Suffixes</name>
+            <type>[Ljava.lang.String;</type>
+         </attribute>
+
+         <attribute access="read-write" getMethod="getRelativeOrder" setMethod="setRelativeOrder">
+            <description>The relative order of the suffixes in the global suffixes list</description>
+            <name>RelativeOrder</name>
+            <type>int</type>
+         </attribute>
+
+         <!-- EJB3DeployerMBean attributes -->
+         <attribute access="read-only" getMethod="getDefaultProperties">
+            <name>DefaultProperties</name>
+            <type>java.util.Properties</type>
+         </attribute>
+
+         <attribute access="read-write" getMethod="getDeployEjb3ExtensionOnly" setMethod="setDeployEjb3ExtensionOnly">
+            <description>If true, .jars will not be examined for annotations, 3.0 descriptors</description>
+            <name>DeployEjb3ExtensionOnly</name>
+            <type>boolean</type>
+         </attribute>
+
+         <attribute access="write-only" setMethod="setJarsIgnoredForScanning">
+            <description>mbean that has list of jars to ignore</description>
+            <name>JarsIgnoredForScanning</name>
+            <type>org.jboss.ejb3.JarsIgnoredForScanningMBean</type>
+         </attribute>
+
+         <!-- ServiceMBean operations -->
+         <operation>
+            <description>Standard MBean lifecycle method</description>
+            <name>create</name>
+         </operation>
+
+         <operation>
+            <description>The start lifecycle operation</description>
+            <name>start</name>
+         </operation>
+
+         <operation>
+            <description>The stop lifecycle operation</description>
+            <name>stop</name>
+         </operation>
+
+         <operation>
+            <description>The destroy lifecycle operation</description>
+            <name>destroy</name>
+         </operation>
+
+         <operation>
+            <description>The detyped lifecycle operation (for internal use only)</description>
+            <name>jbossInternalLifecycle</name>
+            <parameter>
+               <description>The lifecycle operation</description>
+               <name>method</name>
+               <type>java.lang.String</type>
+            </parameter>
+            <return-type>void</return-type>
+         </operation>
+
+         <!-- SubDeployerMBean operations -->
+         <operation>
+            <description>Accept a module for deployment</description>
+            <name>accepts</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+            <return-type>boolean</return-type>
+         </operation>
+
+         <operation>
+            <description>Initialize deployment step</description>
+            <name>init</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Create deployment step</description>
+            <name>create</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Start deployment step</description>
+            <name>start</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Stop deployment step</description>
+            <name>stop</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Destroy deployment step</description>
+            <name>destroy</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <!-- Interceptable operations -->
+         <operation>
+            <description>Add dynamically an operation interceptor</description>
+            <name>addOperationInterceptor</name>
+            <parameter>
+               <description>The Interceptor</description>
+               <name>interceptor</name>
+               <type>org.jboss.mx.interceptor.Interceptor</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Remove dynamically an operation interceptor</description>
+            <name>removeOperationInterceptor</name>
+            <parameter>
+               <description>The Interceptor</description>
+               <name>interceptor</name>
+               <type>org.jboss.mx.interceptor.Interceptor</type>
+            </parameter>
+         </operation>
+      </xmbean>
+      <!-- Inline XMBean Descriptor END -->
+
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <depends>jboss.ejb:service=EJBDeployer</depends>
+      <depends optional-attribute-name="JarsIgnoredForScanning" proxy-type="org.jboss.ejb3.JarsIgnoredForScanningMBean">jboss.ejb3:service=JarsIgnoredForScanning</depends>
+   </mbean>
+
+</server>

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyRemote.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyRemote.java	2007-08-17 19:23:23 UTC (rev 64666)
@@ -0,0 +1,30 @@
+/*
+ * 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.ejb3.test.statelesscreation;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface DestroyRemote
+{
+   int getBeanCount();
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyStatelessBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyStatelessBean.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/DestroyStatelessBean.java	2007-08-17 19:23:23 UTC (rev 64666)
@@ -0,0 +1,57 @@
+/*
+ * 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.ejb3.test.statelesscreation;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless
+ at Remote(DestroyRemote.class)
+public class DestroyStatelessBean implements DestroyRemote
+{
+   private static final Logger log = Logger.getLogger(DestroyStatelessBean.class);
+   
+   private static int beanCount = 0;
+   
+   public int getBeanCount()
+   {
+      return beanCount;
+   }
+   
+   @PostConstruct
+   public void construct()
+   {
+      ++beanCount;
+   }
+   
+   @PreDestroy
+   public void destroy()
+   {
+      --beanCount;
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/unit/MetricsUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/unit/MetricsUnitTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/statelesscreation/unit/MetricsUnitTestCase.java	2007-08-17 19:23:23 UTC (rev 64666)
@@ -0,0 +1,106 @@
+/*
+ * 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.ejb3.test.statelesscreation.unit;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.test.statelesscreation.DestroyRemote;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class MetricsUnitTestCase
+extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(MetricsUnitTestCase.class);
+
+   public MetricsUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testSLSBCount() throws Exception
+   {
+      DestroyRemote slsb = (DestroyRemote)getInitialContext().lookup("DestroyStatelessBean/remote");
+      assertNotNull(slsb);
+      assertEquals(1, slsb.getBeanCount());
+      
+      for (int i = 0 ; i < 50 ; ++i)
+      {
+         Runnable r = new Runnable()
+         {
+            public void run()
+            {
+               try
+               {
+                  InitialContext jndiContext = getInitialContext();
+                  for (int i = 0 ; i < 100 ; ++i)
+                  {                  
+                     DestroyRemote slsb = (DestroyRemote)jndiContext.lookup("DestroyStatelessBean/remote");              
+                     slsb.getBeanCount();
+                  }
+               }
+               catch (Exception e)
+               {
+                  e.printStackTrace();
+               }
+            }
+         };
+         
+         new Thread(r).start();
+      }
+      
+      Thread.sleep(1 * 60 * 1000);  
+      
+      MBeanServerConnection server = getServer();
+      ObjectName testerName = new ObjectName("jboss.j2ee:jar=statelesscreation-test.jar,name=DestroyStatelessBean,service=EJB3");
+   
+      int size = (Integer)server.getAttribute(testerName, "CurrentSize");
+      System.out.println("CurrentSize=" + size);
+      
+      size = (Integer)server.getAttribute(testerName, "AvailableCount");
+      System.out.println("AvailableCount=" + size);
+      
+      size = (Integer)server.getAttribute(testerName, "MaxSize");
+      System.out.println("MaxSize=" + size);
+      
+      size = (Integer)server.getAttribute(testerName, "RemoveCount");
+      System.out.println("RemoveCount=" + size);
+      
+      size = (Integer)server.getAttribute(testerName, "CreateCount");
+      System.out.println("CreateCount=" + size);
+      assertEquals(30, size);
+      
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(MetricsUnitTestCase.class, "statelesscreation-test.jar");
+   }
+
+}




More information about the jboss-cvs-commits mailing list