[jboss-cvs] JBossAS SVN: r66002 - in trunk/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
Wed Oct 10 04:37:20 EDT 2007
Author: wolfc
Date: 2007-10-10 04:37:20 -0400 (Wed, 10 Oct 2007)
New Revision: 66002
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonBase.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonInterface.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessLocal.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java
Modified:
trunk/ejb3/build-test.xml
Log:
EJBTHREE-1062: unit test
Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml 2007-10-10 08:35:26 UTC (rev 66001)
+++ trunk/ejb3/build-test.xml 2007-10-10 08:37:20 UTC (rev 66002)
@@ -2156,6 +2156,10 @@
<build-simple-jar name="ejbthree1060"/>
</target>
+ <target name="ejbthree1062" depends="compile-classes">
+ <build-simple-jar name="ejbthree1062"/>
+ </target>
+
<target name="jbas4489"
description="Builds a simple jar files."
depends="compile-classes">
@@ -3688,6 +3692,7 @@
ejbthree953, ejbthree957, ejbthree959, ejbthree963, ejbthree967, ejbthree971, ejbthree973, ejbthree985, ejbthree986,
ejbthree989, ejbthree1020, ejbthree1023, ejbthree1025, ejbthree1040, ejbthree1058,
ejbthree1060,
+ ejbthree1062,
jaxws,
aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
securitydomain, enventry, security5,
@@ -4644,6 +4649,9 @@
<param name="test" value="ejbthree1060"/>
</antcall>
<antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree1062"/>
+ </antcall>
+ <antcall target="test" inheritRefs="true">
<param name="test" value="statelesscreation"/>
</antcall>
<antcall target="test" inheritRefs="true">
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonBase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonBase.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonBase.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+/**
+ * A common base for beans that implements an interface.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class CommonBase implements CommonInterface
+{
+
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonBase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonInterface.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonInterface.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface CommonInterface
+{
+ String sayHiTo(String name);
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CommonInterface.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessBean.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+import javax.ejb.Stateless;
+
+/**
+ * This bean only implements one interface, so that interface
+ * should become the local business interface (4.6.6)
+ *
+ * But it extends a common base which also implements an interface.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class MyStatelessBean extends CommonBase implements MyStatelessLocal
+{
+ public String sayHiTo(String name)
+ {
+ return "Hi " + name;
+ }
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessLocal.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessLocal.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+/**
+ * This business interface should not be annotated.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface MyStatelessLocal
+{
+ String sayHiTo(String name);
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/MyStatelessLocal.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+import javax.ejb.Remote;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface Tester extends CommonInterface
+{
+
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class TesterBean implements Tester
+{
+ @EJB
+ private MyStatelessLocal bean;
+
+ public String sayHiTo(String name)
+ {
+ return bean.sayHiTo(name);
+ }
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java 2007-10-10 08:37:20 UTC (rev 66002)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejbthree1062.unit;
+
+import java.util.Date;
+
+import javax.naming.NameNotFoundException;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1062.Tester;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * If bean class implements a single interface, that interface is assumed to be the busi-
+ * ness interface of the bean. This business interface will be a local interface unless the
+ * interface is designated as a remote business interface by use of the Remote annota-
+ * tion on the bean class or interface or by means of the deployment descriptor.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class DefaultLocalBusinessUnitTestCase extends JBossTestCase
+{
+ public DefaultLocalBusinessUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(DefaultLocalBusinessUnitTestCase.class, "ejbthree1062.jar");
+ }
+
+ public void testSayHiTo() throws Exception
+ {
+ // Guard for errors
+ try
+ {
+ getInitialContext().lookup("MyStatelessBean/local");
+ }
+ catch(NameNotFoundException e)
+ {
+ fail("MyStatelessBean was not deployed properly");
+ }
+ Tester tester = (Tester) getInitialContext().lookup("TesterBean/remote");
+ Date date = new Date();
+ String expected = "Hi " + date;
+ String actual = tester.sayHiTo(date.toString());
+ assertEquals(expected, actual);
+ }
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list