[jboss-cvs] JBossAS SVN: r105218 - in branches/JBPAPP_5_1/testsuite: src/main/org/jboss/test/ws/jaxws/ejb3Integration and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 25 10:24:29 EDT 2010
Author: jaikiran
Date: 2010-05-25 10:24:29 -0400 (Tue, 25 May 2010)
New Revision: 105218
Added:
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoEJB3WSEndpoint.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoWSEndpointImplInSAR.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/unit/
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/unit/EJB3WSEndpointPackagingTestCase.java
Modified:
branches/JBPAPP_5_1/testsuite/imports/sections/ws.xml
Log:
EJBTHREE-2098 Added a testcase for checking that EJBs (exposed as a WS endpoint) deployed in a .jar within a .sar don't run into deployment error
Modified: branches/JBPAPP_5_1/testsuite/imports/sections/ws.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/ws.xml 2010-05-25 13:34:01 UTC (rev 105217)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/ws.xml 2010-05-25 14:24:29 UTC (rev 105218)
@@ -94,6 +94,19 @@
<include name="org/jboss/test/ws/jaxws/ejb3Integration/*.xml"/>
</fileset>
</jar>
+
+ <!--first build the jar and then the .sar -->
+
+ <jar destfile="${build.lib}/ejb3ws-packaging.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/ws/jaxws/ejb3Integration/packaging/*.class"/>
+ </fileset>
+ </jar>
+ <jar destfile="${build.lib}/ejbwspackaging-test.sar">
+ <fileset dir="${build.lib}">
+ <include name="ejb3ws-packaging.jar"/>
+ </fileset>
+ </jar>
<!-- jaxws-injection -->
<jar destfile="${build.lib}/jaxws-injection.jar">
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoEJB3WSEndpoint.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoEJB3WSEndpoint.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoEJB3WSEndpoint.java 2010-05-25 14:24:29 UTC (rev 105218)
@@ -0,0 +1,35 @@
+/*
+ * 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.test.ws.jaxws.ejb3Integration.packaging;
+
+import javax.jws.WebService;
+
+/**
+ * @author Jaikiran Pai
+ *
+ */
+ at WebService
+public interface EchoEJB3WSEndpoint
+{
+
+ String echo(String msg);
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoWSEndpointImplInSAR.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoWSEndpointImplInSAR.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/EchoWSEndpointImplInSAR.java 2010-05-25 14:24:29 UTC (rev 105218)
@@ -0,0 +1,50 @@
+/*
+ * 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.test.ws.jaxws.ejb3Integration.packaging;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+import org.jboss.test.ws.jaxws.ejb3Integration.packaging.unit.EJB3WSEndpointPackagingTestCase;
+
+/**
+ * Used in {@link EJB3WSEndpointPackagingTestCase}
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at WebService(endpointInterface = "org.jboss.test.ws.jaxws.ejb3Integration.packaging.EchoEJB3WSEndpoint")
+ at RemoteBinding(jndiBinding = EchoWSEndpointImplInSAR.JNDI_NAME)
+ at Remote (EchoEJB3WSEndpoint.class)
+public class EchoWSEndpointImplInSAR implements EchoEJB3WSEndpoint
+{
+ public static final String JNDI_NAME = "WSEndpointSLSBInSAR";
+
+ @Override
+ public String echo(String msg)
+ {
+ return msg;
+ }
+}
Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/unit/EJB3WSEndpointPackagingTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/unit/EJB3WSEndpointPackagingTestCase.java (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/packaging/unit/EJB3WSEndpointPackagingTestCase.java 2010-05-25 14:24:29 UTC (rev 105218)
@@ -0,0 +1,74 @@
+/*
+ * 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.test.ws.jaxws.ejb3Integration.packaging.unit;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.jaxws.ejb3Integration.packaging.EchoEJB3WSEndpoint;
+import org.jboss.test.ws.jaxws.ejb3Integration.packaging.EchoWSEndpointImplInSAR;
+
+/**
+ * Tests that a EJB3 Webservice deployed through a .jar within
+ * a .sar file deploys fine without any issues.
+ *
+ * <p>
+ * See https://jira.jboss.org/browse/EJBTHREE-2098 for more details
+ * </p>
+ * <p>
+ * In short, the container name generated for EJB3 beans deployed in .jar with a .sar
+ * top level deployment unit, was incorrect. The .sar deployment unit name wasn't being
+ * considered in the container name generation. Only .ear deployment units were considered.
+ * The fix for EJBTHREE-2098 takes care of this issue.
+ * </p>
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EJB3WSEndpointPackagingTestCase extends JBossWSTest
+{
+ /**
+ * Deploy the .sar
+ * @return
+ */
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(EJB3WSEndpointPackagingTestCase.class, "ejbwspackaging-test.sar");
+ }
+
+ /**
+ * Test a simple access to the bean which is also exposed as a WS endpoint
+ * @throws Exception
+ */
+ public void testRemoteAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ EchoEJB3WSEndpoint ejb3Remote = (EchoEJB3WSEndpoint) iniCtx.lookup(EchoWSEndpointImplInSAR.JNDI_NAME);
+
+ String helloWorld = "Hello world!";
+ Object retObj = ejb3Remote.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+}
More information about the jboss-cvs-commits
mailing list