[jboss-cvs] JBossAS SVN: r68082 - 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
Sun Dec 9 11:50:50 EST 2007


Author: ALRubinger
Date: 2007-12-09 11:50:50 -0500 (Sun, 09 Dec 2007)
New Revision: 68082

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateRemoteBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBusinessBase.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocal.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalHome.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemote.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteHome.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.java
Modified:
   trunk/ejb3/build-test.xml
Log:
[EJBTHREE-1127][JBAS-5036] Added Unit Tests

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-12-09 16:49:26 UTC (rev 68081)
+++ trunk/ejb3/build-test.xml	2007-12-09 16:50:50 UTC (rev 68082)
@@ -2241,6 +2241,10 @@
    <target name="ejbthree1146" depends="compile-classes">
       <build-simple-jar name="ejbthree1146"/>
    </target>
+	
+   <target name="ejbthree1154" depends="compile-classes">
+      <build-simple-jar name="ejbthree1154"/>
+   </target>
 
    <target name="jbas4489"
       description="Builds a simple jar files."
@@ -3862,7 +3866,7 @@
       ejbthree1057, ejbthree1060,
       ejbthree1062,
       ejbthree1066, ejbthree1071, ejbthree1075, ejbthree1082, ejbthree1090, ejbthree1092, ejbthree1119, ejbthree1122, ejbthree1123, ejbthree1127,
-      ejbthree1146, jaxws, jbas4489,
+      ejbthree1146, ejbthree1154, jaxws, jbas4489,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
       securitydomain, enventry, security5,
       jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions,
@@ -4860,6 +4864,9 @@
          <param name="test" value="ejbthree1146"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+         <param name="test" value="ejbthree1154"/>
+      </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/ejbthree1154/DelegateBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateBean.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+/**
+ * A Test Delegate Bean to access the local methods of the TestBean
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(DelegateRemoteBusiness.class)
+ at RemoteBinding(jndiBinding = DelegateRemoteBusiness.JNDI_NAME)
+public class DelegateBean implements DelegateRemoteBusiness
+{
+   // Instance Members
+   @EJB
+   private TestLocalHome home;
+
+   @EJB
+   private TestLocalBusiness localBusiness;
+
+   // Required Implementations
+
+   public boolean testBeanReturnsCorrectLocal21ViewFromHomeCreate()
+   {
+
+      // Initialize
+      TestLocal test = null;
+
+      // Obtain 2.1 view
+      try
+      {
+         test = home.create();
+      }
+      catch (CreateException e)
+      {
+         throw new RuntimeException(e);
+      }
+
+      // Invoke and ensure returns as expected
+      if (test.test() != TestLocal.RETURN_VALUE)
+      {
+         throw new RuntimeException("Invocation on " + TestLocal.class.getName() + " resulted in unexpected result");
+      }
+
+      // Everything's OK
+      return true;
+
+   }
+
+   public boolean testBeanReturnsCorrectlyFromLocalBusinessInterface()
+   {
+      // Invoke and ensure returns as expected
+      if (localBusiness.test() != TestLocalBusiness.RETURN_VALUE)
+      {
+         throw new RuntimeException("Invocation on " + TestLocalBusiness.class.getName()
+               + " resulted in unexpected result");
+      }
+
+      // All OK
+      return true;
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateRemoteBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateRemoteBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateRemoteBusiness.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+/**
+ * A Test Delegate Bean to access the local methods of the TestBean
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface DelegateRemoteBusiness
+{
+   String JNDI_NAME = "DelegateBean/remote";
+   
+   boolean testBeanReturnsCorrectLocal21ViewFromHomeCreate();
+   
+   boolean testBeanReturnsCorrectlyFromLocalBusinessInterface();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/DelegateRemoteBusiness.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBean.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import javax.ejb.Local;
+import javax.ejb.LocalHome;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalHomeBinding;
+import org.jboss.ejb3.annotation.RemoteHomeBinding;
+
+/**
+ * A Test EJB 
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(TestLocalBusiness.class)
+ at LocalHome(TestLocalHome.class)
+ at LocalHomeBinding(jndiBinding = TestLocalHome.JNDI_NAME)
+ at Remote(TestRemoteBusiness.class)
+ at RemoteHome(TestRemoteHome.class)
+ at RemoteHomeBinding(jndiBinding=TestRemoteHome.JNDI_NAME)
+public class TestBean implements TestLocalBusiness, TestRemoteBusiness
+{
+   // Required Implementations
+   public int test(){
+      return TestBusinessBase.RETURN_VALUE;
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBusinessBase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBusinessBase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBusinessBase.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+/**
+ * A TestBusiness Base
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestBusinessBase
+{
+   int RETURN_VALUE = 1;
+
+   int test();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestBusinessBase.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocal.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocal.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ * A Test Local Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocal extends EJBLocalObject, TestLocalBusiness
+{
+
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalBusiness.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+/**
+ * A Test Local Business Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocalBusiness extends TestBusinessBase
+{
+   String JNDI_NAME = "TestBean/local";
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalBusiness.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalHome.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalHome.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalHome.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+
+/**
+ * A Test Local Home
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocalHome extends EJBLocalHome
+{
+   String JNDI_NAME = "TestBean/localHome";
+   
+   TestLocal create() throws CreateException;
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestLocalHome.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemote.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemote.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import javax.ejb.EJBObject;
+
+/**
+ * A Test Remote Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemote extends EJBObject, TestRemoteBusiness
+{
+
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemote.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteBusiness.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+/**
+ * A Test Remote Business Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemoteBusiness extends TestBusinessBase
+{
+   String JNDI_NAME = "TestBean/remote";
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteBusiness.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteHome.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteHome.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteHome.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * A Test Remote Home
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemoteHome extends EJBHome
+{
+   String JNDI_NAME = "TestBean/remoteHome";
+
+   TestRemote create() throws RemoteException, CreateException;
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/TestRemoteHome.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.java	2007-12-09 16:50:50 UTC (rev 68082)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree1154.unit;
+
+import javax.rmi.PortableRemoteObject;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1154.DelegateRemoteBusiness;
+import org.jboss.ejb3.test.ejbthree1154.TestRemote;
+import org.jboss.ejb3.test.ejbthree1154.TestRemoteBusiness;
+import org.jboss.ejb3.test.ejbthree1154.TestRemoteHome;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * A Test to ensure that an EJB with the 2.1 Local/Remote interfaces
+ * not explicitly-defined can be properly returned from the "create"
+ * methods of the Home interfaces
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase extends JBossTestCase
+{
+   // Constructor
+
+   public NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Suite
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.class,
+            "ejbthree1154.jar");
+   }
+
+   // Tests
+
+   /**
+    * Tests the 2.1 Remote view from a Home create() method
+    */
+   public void testRemoteInterfaceFromHomeCreate() throws Exception
+   {
+      // Initialize
+      TestRemoteHome home = null;
+
+      // Lookup Home
+      home = (TestRemoteHome) PortableRemoteObject.narrow(this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME),
+            TestRemoteHome.class);
+
+      // Get 2.1 View
+      TestRemote ejb = home.create();
+
+      // Invoke and ensure correct
+      assertEquals(ejb.test(), TestRemote.RETURN_VALUE);
+
+   }
+
+   /**
+    * Tests the Business Remote view from a JNDI Lookup
+    */
+   public void testRemoteBusinessInterfaceFromLookup() throws Exception
+   {
+      // Initialize
+      TestRemoteBusiness ejb = null;
+
+      // Lookup Business
+      ejb = (TestRemoteBusiness) PortableRemoteObject.narrow(this.getInitialContext().lookup(
+            TestRemoteBusiness.JNDI_NAME), TestRemoteBusiness.class);
+
+      // Invoke and ensure correct
+      assertEquals(ejb.test(), TestRemoteBusiness.RETURN_VALUE);
+
+   }
+
+   /**
+    * Tests the 2.1 Local view from a Home create() method, 
+    * via a Remote Business Delegate
+    */
+   public void testLocalInterfaceFromHomeCreate() throws Exception
+   {
+      // Initialize
+      DelegateRemoteBusiness delegate = this.getRemoteDelegate();
+
+      // Invoke and ensure correct
+      assertTrue(delegate.testBeanReturnsCorrectLocal21ViewFromHomeCreate());
+
+   }
+
+   /**
+    * Tests the 2.1 Local view from a Home create() method, 
+    * via a Remote Business Delegate
+    */
+   public void testLocalBusinessInterface() throws Exception
+   {
+      // Initialize
+      DelegateRemoteBusiness delegate = this.getRemoteDelegate();
+
+      // Invoke and ensure correct
+      assertTrue(delegate.testBeanReturnsCorrectlyFromLocalBusinessInterface());
+
+   }
+
+   // Internal Helper Methods
+   private DelegateRemoteBusiness getRemoteDelegate() throws Exception
+   {
+      // Initialize
+      DelegateRemoteBusiness delegate = null;
+
+      // Lookup Delegate
+      delegate = (DelegateRemoteBusiness) PortableRemoteObject.narrow(this.getInitialContext().lookup(
+            DelegateRemoteBusiness.JNDI_NAME), DelegateRemoteBusiness.class);
+
+      // Return 
+      return delegate;
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1154/unit/NotExplicitlyDefined21InterfaceReturnsCorrectTypeFromHomeUnitTestCase.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the jboss-cvs-commits mailing list