[Jboss-cvs] JBossAS SVN: r56543 - in trunk/ejb3: . src/test/org/jboss/ejb3/test/regression src/test/org/jboss/ejb3/test/regression/ejbthree653 src/test/org/jboss/ejb3/test/regression/ejbthree653/unit
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Sep 4 07:41:26 EDT 2006
Author: wolfc
Date: 2006-09-04 07:41:18 -0400 (Mon, 04 Sep 2006)
New Revision: 56543
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21.java
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Bean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Home.java
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateless.java
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStatelessBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/unit/
trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/unit/PoolingSLBSTestCase.java
Modified:
trunk/ejb3/build-test.xml
Log:
EJBTHREE-653: unit test
Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/build-test.xml 2006-09-04 11:41:18 UTC (rev 56543)
@@ -1598,6 +1598,19 @@
</jar>
</target>
+ <target name="ejbthree653"
+ description="Builds all jar files."
+ depends="compile-classes">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/ejbthree653.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/regression/ejbthree653/*.class"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="ejbthree670"
description="Builds all jar files."
depends="compile-classes">
@@ -2584,7 +2597,8 @@
<target name="jars" depends="mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ejbthree440,
- ejbthree454, ejbthree670, aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, securitydomain, enventry,
+ ejbthree454, ejbthree653, ejbthree670, aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
+ securitydomain, enventry,
jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions,
exception, dd/override, stateless, standalone-jar, dd/mdb, bank, dd, longlived, xmlcfg, hbm, pkg, regressionHHH275,
entityexception, asynchronous, consumer, clusteredentity, secondary, stateful, service, lob, cache, initial,
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,37 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface MyStateful21 extends EJBObject
+{
+ String sayHelloTo(String name) throws RemoteException;
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Bean.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Bean.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,75 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJB;
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateful;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at Remote(MyStateful21.class)
+ at RemoteHome(MyStateful21Home.class)
+public class MyStateful21Bean implements SessionBean
+{
+ private static final long serialVersionUID = 1L;
+
+ @SuppressWarnings("unused")
+ private static final Logger log = Logger.getLogger(MyStateful21Bean.class);
+
+ @EJB
+ private MyStateless delegate;
+
+ public void ejbActivate() throws EJBException, RemoteException
+ {
+ }
+
+ public void ejbPassivate() throws EJBException, RemoteException
+ {
+ }
+
+ public void ejbRemove() throws EJBException, RemoteException
+ {
+ }
+
+ public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
+ {
+ }
+
+ public String sayHelloTo(String name)
+ {
+ return delegate.sayHelloTo(name);
+ }
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Home.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Home.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateful21Home.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,38 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface MyStateful21Home extends EJBHome
+{
+ MyStateful21 create() throws CreateException, RemoteException;
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateless.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateless.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStateless.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,33 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface MyStateless
+{
+ String sayHelloTo(String name);
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStatelessBean.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/MyStatelessBean.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,71 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(MyStateless.class)
+public class MyStatelessBean
+{
+ private static long currentThreadId;
+
+ /**
+ * EJBCreate method.
+ */
+ @PostConstruct
+ public void ejb3Create()
+ {
+ System.out.println("New SessionBean " + this);
+ System.out.println("Thread " + Thread.currentThread().getId());
+ //setupBean();
+ if(currentThreadId == 0)
+ {
+ currentThreadId = Thread.currentThread().getId();
+ }
+ else
+ {
+ if(Thread.currentThread().getId() == currentThreadId)
+ {
+ throw new IllegalStateException("no new instance should be created");
+ }
+ else
+ {
+ // could happen with remoting 2.0
+ currentThreadId = Thread.currentThread().getId();
+ }
+ }
+ }
+
+ public String sayHelloTo(String name)
+ {
+ return "Hi " + name;
+ }
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/unit/PoolingSLBSTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/unit/PoolingSLBSTestCase.java 2006-09-04 04:15:00 UTC (rev 56542)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/regression/ejbthree653/unit/PoolingSLBSTestCase.java 2006-09-04 11:41:18 UTC (rev 56543)
@@ -0,0 +1,63 @@
+/*
+ * 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.ejb3.test.regression.ejbthree653.unit;
+
+import java.util.Date;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.regression.ejbthree653.MyStateful21;
+import org.jboss.ejb3.test.regression.ejbthree653.MyStateful21Home;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class PoolingSLBSTestCase extends JBossTestCase
+{
+
+ public PoolingSLBSTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void test1() throws Exception
+ {
+ MyStateful21Home home = (MyStateful21Home) getInitialContext().lookup("MyStateful21Bean/remoteHome");
+ MyStateful21 session = home.create();
+ for(int i = 0; i < 1000; i++)
+ {
+ String me = new Date().toString();
+ String expected = "Hi " + me;
+ String actual = session.sayHelloTo(me);
+ assertEquals(expected, actual);
+ }
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(PoolingSLBSTestCase.class, "ejbthree653.jar");
+ }
+}
More information about the jboss-cvs-commits
mailing list