[jboss-cvs] JBossAS SVN: r65731 - in trunk/ejb3: src/test/org/jboss/ejb3/test/webservices/jsr181 and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 1 15:39:47 EDT 2007


Author: bdecoste
Date: 2007-10-01 15:39:46 -0400 (Mon, 01 Oct 2007)
New Revision: 65731

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3Bean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteHomeInterface.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteInterface.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEndpointInterface.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/RemoteHomeInterface.java
Modified:
   trunk/ejb3/build-test.xml
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/EJB3Bean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/unit/JSR181TestCase.java
Log:
[JBCTS-540] merged tests from Branch_4_2 for narrowing jsr-181 beans

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-10-01 18:09:59 UTC (rev 65730)
+++ trunk/ejb3/build-test.xml	2007-10-01 19:39:46 UTC (rev 65731)
@@ -265,6 +265,7 @@
       <path refid="sun.servlet.classpath"/>
       <pathelement path="${jboss.dist}/client/jbossall-client.jar"/>
       <pathelement path="${jboss.dist}/client/jboss-ejb3-client.jar"/>
+	  <pathelement path="${jboss.dist}/lib/jboss-vfs.jar"/>
       <path refid="jboss.microcontainer.classpath"/>
    </path>
 
@@ -914,8 +915,10 @@
 
       <jar jarfile="${build.lib}/jsr181.jar">
          <fileset dir="${build.classes}">
-            <include name="org/jboss/ejb3/test/webservices/jsr181/EJB3*.class"/>
+         	<include name="org/jboss/ejb3/test/webservices/jsr181/EJB3*.class"/>
+         	<include name="org/jboss/ejb3/test/webservices/jsr181/*HomeInterface.class"/>
             <include name="org/jboss/ejb3/test/webservices/jsr181/Stateless*.class"/>
+         	<include name="org/jboss/ejb3/test/webservices/jsr181/Narrowable*.class"/>
          </fileset>
          <fileset dir="${resources}/test/webservices">
          	<include name="META-INF/ejb-jar.xml"/>
@@ -925,6 +928,7 @@
       <jar jarfile="${build.lib}/jsr181-client.jar">
          <fileset dir="${build.classes}">
             <include name="org/jboss/ejb3/test/webservices/jsr181/EndpointInterface.class"/>
+			<include name="org/jboss/ejb3/test/webservices/jsr181/NarrowableEndpointInterface.class"/>
          </fileset>
          <fileset dir="${resources}/test/webservices">
             <include name="META-INF/application-client.xml"/>

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/EJB3Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/EJB3Bean.java	2007-10-01 18:09:59 UTC (rev 65730)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/EJB3Bean.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -24,6 +24,7 @@
 import org.jboss.annotation.ejb.RemoteBinding;
 
 import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
 import javax.ejb.Stateless;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
@@ -37,6 +38,7 @@
 @SOAPBinding(style = SOAPBinding.Style.RPC)
 @Remote(EJB3RemoteInterface.class)
 @RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
+ at RemoteHome(RemoteHomeInterface.class)
 @Stateless
 public class EJB3Bean implements EJB3RemoteInterface
 {

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3Bean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3Bean.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -0,0 +1,49 @@
+/*
+ * 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.webservices.jsr181;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 62396 $
+ */
+ at WebService(name = "NarrowableEndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "NarrowableTestService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+ at Remote(NarrowableEJB3RemoteInterface.class)
+ at RemoteHome(NarrowableEJB3RemoteHomeInterface.class)
+ at Stateless
+public class NarrowableEJB3Bean
+{
+   @WebMethod
+   public String echo(String input) throws RemoteException
+   {
+      return input;
+   }
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteHomeInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteHomeInterface.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteHomeInterface.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -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.webservices.jsr181;
+
+import javax.ejb.EJBHome;
+
+/**
+ * @author carlo
+ *
+ */
+public interface NarrowableEJB3RemoteHomeInterface extends EJBHome
+{
+   NarrowableEJB3RemoteInterface create() throws java.rmi.RemoteException, javax.ejb.CreateException;
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteInterface.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEJB3RemoteInterface.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -0,0 +1,37 @@
+/*
+ * 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.webservices.jsr181;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * An EJB3 remote interface
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 10-May-2005
+ */
+public interface NarrowableEJB3RemoteInterface extends EJBObject
+{
+   String echo(String input) throws RemoteException;
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEndpointInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEndpointInterface.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/NarrowableEndpointInterface.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -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.webservices.jsr181;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * Test the JSR-181 javax.jws.WebService annotation on an SEI
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+ at WebService(name = "NarrowableEndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "NarrowableTestService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface NarrowableEndpointInterface extends Remote
+{
+   String echo(String input) throws RemoteException;
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/RemoteHomeInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/RemoteHomeInterface.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/jsr181/RemoteHomeInterface.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -0,0 +1,33 @@
+/*
+ * 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.webservices.jsr181;
+
+import javax.ejb.*;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface RemoteHomeInterface extends EJBHome {
+    
+  public EJB3RemoteInterface create() throws java.rmi.RemoteException, javax.ejb.CreateException;
+} 
+

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/unit/JSR181TestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/unit/JSR181TestCase.java	2007-10-01 18:09:59 UTC (rev 65730)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/webservices/unit/JSR181TestCase.java	2007-10-01 19:39:46 UTC (rev 65731)
@@ -24,12 +24,16 @@
 import junit.framework.Test;
 import org.jboss.ejb3.test.webservices.jsr181.EJB3RemoteInterface;
 import org.jboss.ejb3.test.webservices.jsr181.EndpointInterface;
+import org.jboss.ejb3.test.webservices.jsr181.NarrowableEJB3RemoteHomeInterface;
+import org.jboss.ejb3.test.webservices.jsr181.NarrowableEJB3RemoteInterface;
+import org.jboss.ejb3.test.webservices.jsr181.RemoteHomeInterface;
 import org.jboss.ejb3.test.webservices.jsr181.StatelessRemote;
 import org.jboss.test.JBossTestCase;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
 import javax.xml.rpc.Service;
 import java.util.Hashtable;
 
@@ -53,7 +57,36 @@
       Object retObj = ejb3Remote.echo(helloWorld);
       assertEquals(helloWorld, retObj);
    }
+   
+   public void testHomeRemoteAccess() throws Exception
+   {
+      InitialContext iniCtx = getInitialContext();
+      RemoteHomeInterface home = (RemoteHomeInterface)iniCtx.lookup("EJB3Bean/home");
+      EJB3RemoteInterface ejb3Remote = home.create();
 
+      String helloWorld = "Hello world!";
+      Object retObj = ejb3Remote.echo(helloWorld);
+      assertEquals(helloWorld, retObj);
+   }
+   
+   public void testNarrowedHomeRemoteAccess() throws Exception
+   {
+      InitialContext jndiContext = getInitialContext();
+  
+      Object proxy = jndiContext.lookup("NarrowableEJB3Bean/home");
+      assertNotNull(proxy);
+      
+      NarrowableEJB3RemoteHomeInterface home = (NarrowableEJB3RemoteHomeInterface)PortableRemoteObject.narrow(proxy, NarrowableEJB3RemoteHomeInterface.class);
+      assertNotNull(home);
+      Object obj = home.create();
+      System.out.println(obj);
+      NarrowableEJB3RemoteInterface ejb3Remote = home.create();
+
+      String helloWorld = "Hello world!";
+      Object retObj = ejb3Remote.echo(helloWorld);
+      assertEquals(helloWorld, retObj);
+   }
+
    public void testWebService() throws Exception
    {
       InitialContext iniCtx = getInitialContext();




More information about the jboss-cvs-commits mailing list