[jboss-cvs] JBossAS SVN: r64086 - in branches/Branch_4_2/ejb3: src/test/org/jboss/ejb3/test and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 16 19:26:14 EDT 2007


Author: bdecoste
Date: 2007-07-16 19:26:13 -0400 (Mon, 16 Jul 2007)
New Revision: 64086

Added:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessRemote.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/unit/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/unit/ConcurrentNamingTestCase.java
Modified:
   branches/Branch_4_2/ejb3/build-test.xml
Log:
[EJBTHREE-1009] added concurrentnaming test source

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-07-16 23:16:54 UTC (rev 64085)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-07-16 23:26:13 UTC (rev 64086)
@@ -2782,7 +2782,7 @@
    	
 	  <copy file="${build.lib}/stateless-test.jar" tofile="${build.lib}/stateless-test.ejb3"/>
    </target>
-   
+
    <target name="concurrentnaming"
       description="Builds all jar files."
       depends="compile-classes">

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessBean.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessBean.java	2007-07-16 23:26:13 UTC (rev 64086)
@@ -0,0 +1,41 @@
+/*
+ * 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.concurrentnaming;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless
+ at Remote(StatelessRemote.class)
+public class StatelessBean implements StatelessRemote
+{
+   private static final Logger log = Logger.getLogger(StatelessBean.class);
+   
+   public void test() 
+   {
+      log.info("--- test ");
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessRemote.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/StatelessRemote.java	2007-07-16 23:26:13 UTC (rev 64086)
@@ -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.concurrentnaming;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatelessRemote
+{
+   void test();
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/unit/ConcurrentNamingTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/unit/ConcurrentNamingTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/concurrentnaming/unit/ConcurrentNamingTestCase.java	2007-07-16 23:26:13 UTC (rev 64086)
@@ -0,0 +1,78 @@
+/*
+ * 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.concurrentnaming.unit;
+
+import org.jboss.ejb3.test.concurrentnaming.StatelessRemote;
+
+import javax.naming.InitialContext;
+
+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 ConcurrentNamingTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(ConcurrentNamingTestCase.class);
+
+   public ConcurrentNamingTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testConcurrentNaming() throws Exception
+   {   
+      for (int i = 0 ; i < 20 ; ++i)
+      {
+          Runnable r = new Runnable()
+          {
+             public void run()
+             {
+                try
+                {
+                   InitialContext jndiContext = new InitialContext();
+                   for (int i = 0 ; i < 100 ; ++i)
+                   {                  
+                      StatelessRemote slsb = (StatelessRemote) jndiContext.lookup("StatelessBean/remote");              
+                      slsb.test();
+                   }
+                }
+                catch (Exception e)
+                {
+                   e.printStackTrace();
+                }
+             }
+          };
+          
+          new Thread(r).start();
+      }
+      System.out.println("Done!!");
+      Thread.sleep(1 * 60 * 1000);  
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ConcurrentNamingTestCase.class, "concurrentnaming-test.jar");
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list