[jboss-cvs] JBossAS SVN: r77010 - in trunk/testsuite: imports/sections and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 13 07:46:11 EDT 2008
Author: alessio.soldano at jboss.com
Date: 2008-08-13 07:46:11 -0400 (Wed, 13 Aug 2008)
New Revision: 77010
Added:
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/BusinessInterface.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/ContextAccessingHandler.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/Ejb3WSEndpoint.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericHandler.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericSOAPHandler.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/HandlerContextEndpoint.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/SimpleEndpoint.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceContextEndpoint.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefAppClient.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefBean.java
trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/
trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/handlerchain.xml
Modified:
trunk/testsuite/build.xml
trunk/testsuite/imports/sections/ws.xml
Log:
[JBAS-4773] Adding some ws-ejb3 integration tests to the testsuite and adding the target to run the jaxws tests
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2008-08-13 11:37:28 UTC (rev 77009)
+++ trunk/testsuite/build.xml 2008-08-13 11:46:11 UTC (rev 77010)
@@ -2349,7 +2349,67 @@
</batchtest>
</junit>
</target>
+
+ <!-- Run the Web Services JAX-WS Tests-->
+ <target name="tests-ws"
+ description="Execute Web Services JAX-WS Related Tests">
+ <junit dir="${module.output}"
+ printsummary="${junit.printsummary}"
+ haltonerror="${junit.haltonerror}"
+ haltonfailure="${junit.haltonfailure}"
+ fork="${junit.fork}"
+ timeout="${junit.timeout}"
+ showoutput="${junit.showoutput}"
+ jvm="${junit.jvm}">
+
+ <jvmarg line="${junit.jvm.options}"/>
+ <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/>
+ <sysproperty key="jbosstest.secure" value="true"/>
+
+ <jvmarg value="-Djava.security.manager"/>
+ <sysproperty key="java.security.policy" value="${build.resources}/security/tst.policy"/>
+ <sysproperty key="java.security.auth.login.config" value="${build.resources}/security/auth.conf"/>
+ <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
+ <!-- [JBAS-3969] IOException: unknown protocol: vfsfile -->
+ <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
+ <sysproperty key="jbosstest.server.host" value="${node0}"/>
+ <sysproperty key="build.testlog" value="${build.testlog}"/>
+ <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
+ <!-- Pass along any jbosstest.* system properties -->
+ <syspropertyset>
+ <propertyref prefix="jbosstest."/>
+ </syspropertyset>
+
+ <!-- The crimson parser cannot do schema validation, which we need for jaxrpc-mapping.xml -->
+ <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed"/>
+
+ <classpath>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}/security"/>
+ <pathelement location="${build.resources}"/>
+ <path refid="tests.classpath"/>
+ </classpath>
+
+ <!-- formatter type="xml" usefile="${junit.formatter.usefile}"/ -->
+ <sysproperty key="jboss-junit-configuration" value="tests-webservice"/>
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
+ usefile="${junit.formatter.usefile}"
+ extension="-tests-ws.xml"/>
+ <formatter type="plain" usefile="${junit.formatter.usefile}"/>
+
+ <batchtest todir="${build.reports}"
+ haltonerror="${junit.batchtest.haltonerror}"
+ haltonfailure="${junit.batchtest.haltonfailure}"
+ fork="${junit.batchtest.fork}">
+
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/ws/**/*TestCase.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
<!--
| Standard jaxr tests that should run successfully against a
| JBoss server distribution build that contains jaxr.
Modified: trunk/testsuite/imports/sections/ws.xml
===================================================================
--- trunk/testsuite/imports/sections/ws.xml 2008-08-13 11:37:28 UTC (rev 77009)
+++ trunk/testsuite/imports/sections/ws.xml 2008-08-13 11:46:11 UTC (rev 77010)
@@ -84,7 +84,17 @@
<include name="wsdl/**"/>
</metainf>
</jar>
+
+ <!-- webservices-ejb3 -->
+ <jar destfile="${build.lib}/webservices-ejb3.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/ws/jaxws/ejb3Integration/*.class"/>
+ </fileset>
+ <fileset dir="${build.resources}/ws/jaxws/ejb3Integration">
+ <include name="org/jboss/test/ws/jaxws/ejb3Integration/*.xml"/>
+ </fileset>
+ </jar>
</target>
-
+
</project>
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/BusinessInterface.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/BusinessInterface.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/BusinessInterface.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+import javax.jws.WebService;
+import javax.ejb.Remote;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Remote
+public interface BusinessInterface
+{
+ String echo(String msg);
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/BusinessInterface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/ContextAccessingHandler.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/ContextAccessingHandler.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/ContextAccessingHandler.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -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.test.ws.jaxws.ejb3Integration;
+
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ContextAccessingHandler extends GenericSOAPHandler
+{
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ msgContext.put("invoked", "ContextAccessingHandler:handleInbound()");
+ msgContext.setScope("invoked", MessageContext.Scope.APPLICATION);
+ return true;
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/ContextAccessingHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/Ejb3WSEndpoint.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/Ejb3WSEndpoint.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/Ejb3WSEndpoint.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -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;
+
+import javax.jws.WebService;
+import javax.ejb.Remote;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Remote
+ at WebService
+public interface Ejb3WSEndpoint
+{
+ String echo(String msg);
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/Ejb3WSEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericHandler.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericHandler.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericHandler.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,80 @@
+/*
+ * 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;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * A generic jaxws handler
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericHandler implements Handler
+{
+ private String handlerName;
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerName(String handlerName)
+ {
+ this.handlerName = handlerName;
+ }
+
+ public boolean handleMessage(MessageContext msgContext)
+ {
+ Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (outbound == null)
+ throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ public boolean handleFault(MessageContext messagecontext)
+ {
+ return true;
+ }
+
+ public void close(MessageContext messageContext)
+ {
+ }
+
+ public String toString()
+ {
+ return (handlerName != null ? handlerName : super.toString());
+ }
+}
+
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericSOAPHandler.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericSOAPHandler.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericSOAPHandler.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,55 @@
+/*
+ * 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;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * A generic jaxws soap handler
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends GenericHandler implements SOAPHandler
+{
+ // The header blocks that can be processed by this Handler instance
+ private Set<QName> headers = new HashSet<QName>();
+
+ /** Gets the header blocks that can be processed by this Handler instance.
+ */
+ public Set<QName> getHeaders()
+ {
+ return headers;
+ }
+
+ /** Sets the header blocks that can be processed by this Handler instance.
+ */
+ public void setHeaders(Set<QName> headers)
+ {
+ this.headers = headers;
+ }
+}
+
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/GenericSOAPHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/HandlerContextEndpoint.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/HandlerContextEndpoint.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/HandlerContextEndpoint.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -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;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.HandlerChain;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+/**
+ * Test resource injection with JAX-WS handlers
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+
+ at Stateless
+ at WebService(endpointInterface = "org.jboss.test.ws.jaxws.ejb3Integration.Ejb3WSEndpoint")
+ at HandlerChain(file = "handlerchain.xml")
+public class HandlerContextEndpoint implements Ejb3WSEndpoint
+{
+ @Resource
+ WebServiceContext wsCtx;
+
+ public String echo(String msg)
+ {
+ if(! "ContextAccessingHandler:handleInbound()".equals( wsCtx.getMessageContext().get("invoked") ) )
+ throw new IllegalArgumentException("Wrong webservice context instance or handler not invoked");
+
+ return msg;
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/HandlerContextEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/SimpleEndpoint.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/SimpleEndpoint.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/SimpleEndpoint.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,42 @@
+/*
+ * 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;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Stateless
+ at WebService(endpointInterface = "org.jboss.test.ws.jaxws.ejb3Integration.Ejb3WSEndpoint")
+ at RemoteBinding(jndiBinding = "/test-webservices/SimpleEndpoint")
+public class SimpleEndpoint implements Ejb3WSEndpoint
+{
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/SimpleEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceContextEndpoint.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceContextEndpoint.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceContextEndpoint.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.annotation.Resource;
+import javax.annotation.PostConstruct;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Stateless
+ at RemoteBinding(jndiBinding = "WebServiceContextEndpoint")
+ at WebService(endpointInterface = "org.jboss.test.ws.jaxws.ejb3Integration.Ejb3WSEndpoint")
+public class WebServiceContextEndpoint implements Ejb3WSEndpoint
+{
+
+ @Resource
+ WebServiceContext wsCtx;
+
+ @PostConstruct
+ public void init()
+ {
+ if(null == wsCtx)
+ throw new WebServiceException("WebService context is null @PostConstruct");
+ }
+
+ public String echo(String msg)
+ {
+ return msg +": " +wsCtx.getMessageContext();
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceContextEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefAppClient.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefAppClient.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefAppClient.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import javax.naming.InitialContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+
+public class WebServiceRefAppClient
+{
+ @WebServiceRef(name = "TestService", wsdlLocation = "http://localhost:8080/webservices-ejb3/SimpleEndpoint?wsdl")
+ static Ejb3WSEndpoint serviceRef;
+
+ public static InitialContext iniCtx;
+ public static String retStr;
+
+ public static void main(String[] args)
+ {
+ String inStr = args[0];
+
+ String outStr = serviceRef.echo(inStr);
+ if (inStr.equals(outStr) == false)
+ throw new WebServiceException("Invalid echo return: " + inStr);
+
+ retStr = inStr;
+ }
+}
+
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefAppClient.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefBean.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+import javax.ejb.Stateless;
+import javax.xml.ws.WebServiceRef;
+
+/**
+ * Simple EJB3 bean that delegates to a webservice injected through @WebServiceRef
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Stateless
+ at RemoteBinding(jndiBinding = "/test-webservices/WebServiceRefBean")
+public class WebServiceRefBean implements BusinessInterface
+{
+ @WebServiceRef(wsdlLocation = "http://localhost:8080/webservices-ejb3/SimpleEndpoint?wsdl")
+ Ejb3WSEndpoint serviceRef;
+
+ public String echo(String msg)
+ {
+ return serviceRef.echo(msg);
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceRefBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,119 @@
+/*
+ * 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;
+
+import junit.framework.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+import java.util.Hashtable;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.jaxws.webserviceref.WebServiceRefServletTestCase;
+
+/**
+ * @author Heiko.Braun at jboss.com
+ * @version $Revision$
+ */
+public class WebServiceTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ //return JBossWSTestSetup.newTestSetup(WebServiceTestCase.class, "webservices-ejb3.jar, webservices-ejb3-client.jar");
+ return JBossWSTestSetup.newTestSetup(WebServiceTestCase.class, "webservices-ejb3.jar");
+ }
+
+ public void testRemoteAccess() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ Ejb3WSEndpoint ejb3Remote = (Ejb3WSEndpoint)iniCtx.lookup("/test-webservices/SimpleEndpoint");
+
+ String helloWorld = "Hello world!";
+ Object retObj = ejb3Remote.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ /**
+ * Simple web service test coverage
+ * @throws Exception
+ */
+ public void testWebService() throws Exception
+ {
+ Service service = Service.create(
+ new URL("http://"+getServerHost()+":8080/webservices-ejb3/SimpleEndpoint?wsdl"),
+ new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","SimpleEndpointService")
+ );
+
+ String msg = "testWebService";
+ Ejb3WSEndpoint port = service.getPort(Ejb3WSEndpoint.class);
+ String response = port.echo(msg);
+ assertEquals(msg, response);
+ }
+
+ /**
+ * Test web service context injection
+ * @throws Exception
+ */
+ public void testWebServiceContext() throws Exception
+ {
+ Service service = Service.create(
+ new URL("http://"+getServerHost()+":8080/webservices-ejb3/WebServiceContextEndpoint?wsdl"),
+ new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","WebServiceContextEndpointService")
+ );
+
+ String msg = "testWebServiceContext";
+ Ejb3WSEndpoint port = service.getPort(Ejb3WSEndpoint.class);
+ String response = port.echo(msg);
+ assertNotNull(response);
+ }
+
+ public void testWebServiceRef() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ BusinessInterface ejb3Remote = (BusinessInterface)iniCtx.lookup("/test-webservices/WebServiceRefBean");
+
+ String msg = "testWebServiceRef";
+ Object retObj = ejb3Remote.echo(msg);
+ assertEquals(msg, retObj);
+ }
+
+ /**
+ * Test web service context injection into JAX-WS handler
+ * @throws Exception
+ */
+ public void testHandlerContext() throws Exception
+ {
+ Service service = Service.create(
+ new URL("http://"+getServerHost()+":8080/webservices-ejb3/HandlerContextEndpoint?wsdl"),
+ new QName("http://ejb3Integration.jaxws.ws.test.jboss.org/","HandlerContextEndpointService")
+ );
+
+ String msg = "testHandlerContext";
+ Ejb3WSEndpoint port = service.getPort(Ejb3WSEndpoint.class);
+ String response = port.echo(msg);
+ assertNotNull(response);
+ }
+}
Property changes on: trunk/testsuite/src/main/org/jboss/test/ws/jaxws/ejb3Integration/WebServiceTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/handlerchain.xml
===================================================================
--- trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/handlerchain.xml (rev 0)
+++ trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/handlerchain.xml 2008-08-13 11:46:11 UTC (rev 77010)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://org.jboss.ws/jaxws/handlerscope"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <protocol-bindings>##SOAP11_HTTP</protocol-bindings>
+ <handler>
+ <handler-name>ContextAccessingHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.ejb3Integration.ContextAccessingHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
Property changes on: trunk/testsuite/src/resources/ws/jaxws/ejb3Integration/org/jboss/test/ws/jaxws/ejb3Integration/handlerchain.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
More information about the jboss-cvs-commits
mailing list