[jboss-cvs] JBossAS SVN: r65853 - in branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 4 13:29:03 EDT 2007


Author: wolfc
Date: 2007-10-04 13:29:02 -0400 (Thu, 04 Oct 2007)
New Revision: 65853

Added:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java
Modified:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
Log:
EJBTHREE-786: calling EJB 2.1 view by the book

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	2007-10-04 17:27:02 UTC (rev 65852)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	2007-10-04 17:29:02 UTC (rev 65853)
@@ -15,7 +15,7 @@
  * @author <a href="arubinge at redhat.com">ALR</a>
  * @version $Revision:  $
  */
- at Remote
+//@Remote
 public interface Ejb21View extends EJBObject
 {
    String test();

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	2007-10-04 17:27:02 UTC (rev 65852)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	2007-10-04 17:29:02 UTC (rev 65853)
@@ -7,12 +7,14 @@
 package org.jboss.ejb3.test.ejbthree786;
 
 import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
 import javax.ejb.Stateful;
 
 import org.jboss.annotation.ejb.RemoteBinding;
 
 @Stateful
 @Remote(Ejb21View.class)
+ at RemoteHome(Ejb21ViewHome.class)
 @RemoteBinding(jndiBinding = Ejb21ViewBean.JNDI_NAME_REMOTE)
 public class Ejb21ViewBean
 {

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java	2007-10-04 17:29:02 UTC (rev 65853)
@@ -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.ejbthree786;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * @author carlo
+ *
+ */
+public interface Ejb21ViewHome extends EJBHome
+{
+   Ejb21View create() throws CreateException, RemoteException;
+}


Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewHome.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	2007-10-04 17:27:02 UTC (rev 65852)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	2007-10-04 17:29:02 UTC (rev 65853)
@@ -23,6 +23,7 @@
 
 import javax.ejb.EJBObject;
 import javax.ejb.NoSuchEJBException;
+import javax.rmi.PortableRemoteObject;
 
 import junit.framework.Test;
 
@@ -31,6 +32,7 @@
 import org.jboss.ejb3.test.ejbthree786.DelegateBean;
 import org.jboss.ejb3.test.ejbthree786.Ejb21View;
 import org.jboss.ejb3.test.ejbthree786.Ejb21ViewBean;
+import org.jboss.ejb3.test.ejbthree786.Ejb21ViewHome;
 import org.jboss.ejb3.test.ejbthree786.RemoveStatefulRemote;
 import org.jboss.ejb3.test.ejbthree786.RemoveStatelessRemote;
 import org.jboss.ejb3.test.ejbthree786.StatefulRemoveBean;
@@ -85,17 +87,19 @@
    public void testExplicitExtensionEjbObjectInProxy() throws Exception
    {
       // Obtain stub
-      Ejb21View session = (Ejb21View) getInitialContext().lookup(Ejb21ViewBean.JNDI_NAME_REMOTE);
+      //Ejb21View session = (Ejb21View) getInitialContext().lookup(Ejb21ViewBean.JNDI_NAME_REMOTE);
+      Object obj = getInitialContext().lookup("Ejb21ViewBean/home");
+      Ejb21ViewHome home = (Ejb21ViewHome) PortableRemoteObject.narrow(obj, Ejb21ViewHome.class);
+      Ejb21View session = home.create();
 
       // Ensure EJBObject 
       assertTrue(session instanceof EJBObject);
 
       // Cast and remove appropriately, ensuring removed
-      EJBObject obj = (EJBObject) session;
       boolean removed = false;
       String result = session.test();
       assertEquals(Ejb21ViewBean.TEST_STRING, result);
-      obj.remove();
+      session.remove();
       try
       {
          session.test();




More information about the jboss-cvs-commits mailing list