Author: thomas.diesler(a)jboss.com
Date: 2007-02-27 18:20:58 -0500 (Tue, 27 Feb 2007)
New Revision: 2476
Added:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.java
Modified:
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
Log:
test narrowing the proxy to the remote interface
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-02-27 16:21:04 UTC (rev
2475)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-02-27 23:20:58 UTC (rev
2476)
@@ -171,6 +171,7 @@
<fileset dir="${tests.output.dir}/classes">
<include
name="org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.class"/>
<include
name="org/jboss/test/ws/jaxws/jbws944/EJB3RemoteInterface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.class"/>
</fileset>
</jar>
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-02-27
16:21:04 UTC (rev 2475)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-02-27
23:20:58 UTC (rev 2476)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.jbws944;
import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
@@ -33,6 +34,7 @@
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
+(a)RemoteHome(EJB3RemoteHome.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
@Stateless(name = "FooBean01")
Added:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.java
(rev 0)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.java 2007-02-27
23:20:58 UTC (rev 2476)
@@ -0,0 +1,32 @@
+/*
+ * 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.test.ws.jaxws.jbws944;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+public interface EJB3RemoteHome extends EJBHome
+{
+ EJB3RemoteInterface create() throws RemoteException, CreateException;
+}
Property changes on:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/EJB3RemoteHome.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-02-27
16:21:04 UTC (rev 2475)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-02-27
23:20:58 UTC (rev 2476)
@@ -25,6 +25,7 @@
import java.net.URL;
import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -63,6 +64,20 @@
assertEquals(helloWorld, retObj);
}
+ // This tests whether the remote proxy also implements
+ // the home interface and that it can be narrowed to it.
+ public void testNarrowedRemoteAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Object obj = iniCtx.lookup("/ejb3/EJB3EndpointInterface");
+ EJB3RemoteHome ejb3Home = (EJB3RemoteHome)PortableRemoteObject.narrow(obj,
EJB3RemoteHome.class);
+ EJB3RemoteInterface ejb3Remote = ejb3Home.create();
+
+ String helloWorld = "Hello world!";
+ Object retObj = ejb3Remote.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
public void testWebService() throws Exception
{
assertWSDLAccess();