[jbossws-commits] JBossWS SVN: r16772 - in shared-testsuite/trunk/testsuite/src/test: java/org/jboss/test/ws/jaxws and 4 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Wed Sep 26 06:04:11 EDT 2012
Author: richard.opalka at jboss.com
Date: 2012-09-26 06:04:11 -0400 (Wed, 26 Sep 2012)
New Revision: 16772
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJB3EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptor.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptorImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EndpointIface.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/JBWS3441TestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOEndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptor.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptorImpl.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/WEB-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/WEB-INF/beans.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3441] providing test case
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-09-26 05:08:14 UTC (rev 16771)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-09-26 10:04:11 UTC (rev 16772)
@@ -1246,6 +1246,17 @@
</classes>
</war>
+ <!-- jaxws-jbws3441 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3441.war" needxmlfile="false">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3441/*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/jbws3441/*TestCase.class" />
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws3441/WEB-INF">
+ <include name="beans.xml" />
+ </webinf>
+ </war>
+
<!-- jaxws-jbws3477-custom-provider -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws3477-custom-provider.war" needxmlfile="false">
<classes dir="${tests.output.dir}/test-classes">
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJB3EndpointImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJB3EndpointImpl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJB3EndpointImpl.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at WebService(name = "EJB3Endpoint", serviceName="EJB3EndpointService", targetNamespace = "http://org.jboss.test.ws/jbws3441")
+ at Stateless
+public class EJB3EndpointImpl implements EndpointIface
+{
+ static boolean interceptorCalled;
+
+ @EJBInterceptor
+ public String echo(final String message)
+ {
+ return interceptorCalled ? message + " (including EJB interceptor)" : message;
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptor.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptor.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptor.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+ at InterceptorBinding
+ at Retention(RUNTIME)
+ at Target({METHOD, TYPE})
+public @interface EJBInterceptor {}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptorImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptorImpl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EJBInterceptorImpl.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at EJBInterceptor
+ at Interceptor
+public class EJBInterceptorImpl
+{
+ public EJBInterceptorImpl()
+ {
+ System.out.println("EJB interceptor initialized");
+ }
+
+ @AroundInvoke
+ public Object intercept(final InvocationContext ic) throws Exception
+ {
+ EJB3EndpointImpl.interceptorCalled = true;
+ return ic.proceed();
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EndpointIface.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EndpointIface.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/EndpointIface.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import javax.jws.WebService;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at WebService(name = "EndpointIface", targetNamespace = "http://org.jboss.test.ws/jbws3441")
+public interface EndpointIface
+{
+ public String echo(final String message);
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/JBWS3441TestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/JBWS3441TestCase.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/JBWS3441TestCase.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-3441] Support CDI interceptors for POJO JAX-WS services
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public class JBWS3441TestCase extends JBossWSTest
+{
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS3441TestCase.class, "jaxws-jbws3441.war");
+ }
+
+ private EndpointIface getPojo() throws Exception
+ {
+ final URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3441/POJOEndpointService?wsdl");
+ final QName serviceName = new QName("http://org.jboss.test.ws/jbws3441", "POJOEndpointService");
+ final Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(EndpointIface.class);
+ }
+
+ private EndpointIface getEjb3() throws Exception
+ {
+ final URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3441/EJB3EndpointService/EJB3Endpoint?wsdl");
+ final QName serviceName = new QName("http://org.jboss.test.ws/jbws3441", "EJB3EndpointService");
+ final Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(EndpointIface.class);
+ }
+
+ public void testPojoCall() throws Exception
+ {
+ String message = "Hi";
+ String response = getPojo().echo(message);
+ assertEquals("Hi (including POJO interceptor)", response);
+ }
+
+ public void testEjb3Call() throws Exception
+ {
+ String message = "Hi";
+ String response = getEjb3().echo(message);
+ assertEquals("Hi (including EJB interceptor)", response);
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOEndpointImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOEndpointImpl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOEndpointImpl.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import javax.jws.WebService;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at WebService(name = "POJOEndpoint", serviceName="POJOEndpointService", targetNamespace = "http://org.jboss.test.ws/jbws3441")
+public class POJOEndpointImpl implements EndpointIface
+{
+ static boolean interceptorCalled;
+
+ @POJOInterceptor
+ public String echo(final String message)
+ {
+ return interceptorCalled ? message + " (including POJO interceptor)" : message;
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptor.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptor.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptor.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import javax.interceptor.InterceptorBinding;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+ at InterceptorBinding
+ at Retention(RUNTIME)
+ at Target({METHOD, TYPE})
+public @interface POJOInterceptor {}
Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptorImpl.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptorImpl.java (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3441/POJOInterceptorImpl.java 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.jbws3441;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at POJOInterceptor
+ at Interceptor
+public class POJOInterceptorImpl
+{
+ public POJOInterceptorImpl()
+ {
+ System.out.println("POJO interceptor initialized");
+ }
+
+ @AroundInvoke
+ public Object intercept(final InvocationContext ic) throws Exception
+ {
+ POJOEndpointImpl.interceptorCalled = true;
+ return ic.proceed();
+ }
+}
Added: shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/WEB-INF/beans.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/WEB-INF/beans.xml (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws3441/WEB-INF/beans.xml 2012-09-26 10:04:11 UTC (rev 16772)
@@ -0,0 +1,6 @@
+<beans>
+ <interceptors>
+ <class>org.jboss.test.ws.jaxws.jbws3441.POJOInterceptorImpl</class>
+ <class>org.jboss.test.ws.jaxws.jbws3441.EJBInterceptorImpl</class>
+ </interceptors>
+</beans>
\ No newline at end of file
More information about the jbossws-commits
mailing list