JBossWS SVN: r9692 - stack/metro/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-30 10:48:06 -0400 (Mon, 30 Mar 2009)
New Revision: 9692
Modified:
stack/metro/trunk/modules/testsuite/test-excludes-jboss423.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2074] excluding tests on Metro
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss423.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss423.txt 2009-03-30 14:44:48 UTC (rev 9691)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss423.txt 2009-03-30 14:48:06 UTC (rev 9692)
@@ -19,6 +19,9 @@
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrapped*.*
org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMFeatureTestCase.*
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-03-30 14:44:48 UTC (rev 9691)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-03-30 14:48:06 UTC (rev 9692)
@@ -12,6 +12,9 @@
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrapped*.*
org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMFeatureTestCase.*
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-03-30 14:44:48 UTC (rev 9691)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-03-30 14:48:06 UTC (rev 9692)
@@ -12,6 +12,9 @@
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrapped*.*
org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMFeatureTestCase.*
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-03-30 14:44:48 UTC (rev 9691)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-03-30 14:48:06 UTC (rev 9692)
@@ -12,6 +12,9 @@
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrapped*.*
org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMFeatureTestCase.*
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-03-30 14:44:48 UTC (rev 9691)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-03-30 14:48:06 UTC (rev 9692)
@@ -12,6 +12,9 @@
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrapped*.*
org/jboss/test/ws/jaxws/samples/xop/doclit/MTOMFeatureTestCase.*
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2127] Cannot generate WSDL for binding "http://www.w3.org/2003/05/soap/bindings/HTTP/"
org/jboss/test/ws/jaxws/binding/**
org/jboss/test/ws/jaxws/handlerscope/**
15 years, 9 months
JBossWS SVN: r9691 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-30 10:44:48 -0400 (Mon, 30 Mar 2009)
New Revision: 9691
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss423.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2074] excluding tests on CXF
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss423.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss423.txt 2009-03-30 14:32:11 UTC (rev 9690)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss423.txt 2009-03-30 14:44:48 UTC (rev 9691)
@@ -47,6 +47,9 @@
# [JBWS-2119] WebServiceRef injection from DD doesn't work
org/jboss/test/ws/jaxws/jbws1841/**
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-03-30 14:32:11 UTC (rev 9690)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-03-30 14:44:48 UTC (rev 9691)
@@ -35,6 +35,9 @@
# [JBWS-1655] Add support for endpoint address rewriting
org/jboss/test/ws/jaxws/jbws2150/**
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-03-30 14:32:11 UTC (rev 9690)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-03-30 14:44:48 UTC (rev 9691)
@@ -35,6 +35,9 @@
# [JBWS-1655] Add support for endpoint address rewriting
org/jboss/test/ws/jaxws/jbws2150/**
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-03-30 14:32:11 UTC (rev 9690)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-03-30 14:44:48 UTC (rev 9691)
@@ -35,6 +35,9 @@
# [JBWS-1655] Add support for endpoint address rewriting
org/jboss/test/ws/jaxws/jbws2150/**
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-03-30 14:32:11 UTC (rev 9690)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-03-30 14:44:48 UTC (rev 9691)
@@ -35,6 +35,9 @@
# [JBWS-1655] Add support for endpoint address rewriting
org/jboss/test/ws/jaxws/jbws2150/**
+# [JBWS-2074] Resource injection in jaxws endpoints and handlers
+org/jboss/test/ws/jaxws/jbws2074/**
+
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
15 years, 9 months
JBossWS SVN: r9690 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws and 14 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-03-30 10:32:11 -0400 (Mon, 30 Mar 2009)
New Revision: 9690
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOIface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Iface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Impl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/jaxws-service-handlers.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2074/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/META-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2074] first two usecases
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-03-30 14:16:54 UTC (rev 9689)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2009-03-30 14:32:11 UTC (rev 9690)
@@ -531,7 +531,31 @@
</webinf>
</war>
- <!-- jaxws-jbws2150 -->
+ <!-- jaxws-jbws2074 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2074-usecase1.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/jbws2074/usecase1/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOIface.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml"/>
+ </classes>
+ </war>
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2074-usecase2.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Iface.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Impl.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2074/usecase2/service/jaxws-service-handlers.xml"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2074/usecase2/META-INF">
+ <include name="ejb-jar.xml"/>
+ </metainf>
+ </jar>
+
+ <!-- jaxws-jbws2150 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2150.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2150/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/jbws2150/*Service*.class"/>
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/DescriptorResourcesHandler.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,478 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.handler;
+
+import javax.annotation.PostConstruct;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * This handler is initialized via injections.
+ * Injections can be specified in both web.xml
+ * and ejb-jar.xml. Thus @Resource annotation
+ * is ommited here.
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class DescriptorResourcesHandler extends GenericSOAPHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DescriptorResourcesHandler.class);
+
+ /**
+ * java.lang.Boolean
+ */
+
+ private boolean boolean0;
+
+ private Boolean boolean1;
+
+ private boolean boolean2;
+
+ private void setBoolean2(boolean b)
+ {
+ this.boolean2 = b;
+ }
+
+ private Boolean boolean3;
+
+ private void setBoolean3(Boolean b)
+ {
+ this.boolean3 = b;
+ }
+
+ /**
+ * java.lang.Byte
+ */
+
+ private byte byte0;
+
+ private Byte byte1;
+
+ private byte byte2;
+
+ private void setByte2(byte b)
+ {
+ this.byte2 = b;
+ }
+
+ private Byte byte3;
+
+ private void setByte3(Byte b)
+ {
+ this.byte3 = b;
+ }
+
+ /**
+ * java.lang.Character
+ */
+
+ private char character0;
+
+ private Character character1;
+
+ private char character2;
+
+ private void setCharacter2(char c)
+ {
+ this.character2 = c;
+ }
+
+ private Character character3;
+
+ private void setCharacter3(Character c)
+ {
+ this.character3 = c;
+ }
+
+ /**
+ * java.lang.Short
+ */
+
+ private short short0;
+
+ private Short short1;
+
+ private short short2;
+
+ private void setShort2(short i)
+ {
+ this.short2 = i;
+ }
+
+ private Short short3;
+
+ private void setShort3(Short i)
+ {
+ this.short3 = i;
+ }
+
+ /**
+ * java.lang.Integer
+ */
+
+ private int integer0;
+
+ private Integer integer1;
+
+ private int integer2;
+
+ private void setInteger2(int i)
+ {
+ this.integer2 = i;
+ }
+
+ private Integer integer3;
+
+ private void setInteger3(Integer i)
+ {
+ this.integer3 = i;
+ }
+
+ /**
+ * java.lang.Long
+ */
+
+ private long long0;
+
+ private Long long1;
+
+ private long long2;
+
+ private void setLong2(long l)
+ {
+ this.long2 = l;
+ }
+
+ private Long long3;
+
+ private void setLong3(Long l)
+ {
+ this.long3 = l;
+ }
+
+ /**
+ * java.lang.Float
+ */
+
+ private float float0;
+
+ private Float float1;
+
+ private float float2;
+
+ private void setFloat2(float f)
+ {
+ this.float2 = f;
+ }
+
+ private Float float3;
+
+ private void setFloat3(Float f)
+ {
+ this.float3 = f;
+ }
+
+ /**
+ * java.lang.Double
+ */
+
+ private double double0;
+
+ private Double double1;
+
+ private double double2;
+
+ private void setDouble2(double d)
+ {
+ this.double2 = d;
+ }
+
+ private Double double3;
+
+ private void setDouble3(Double d)
+ {
+ this.double3 = d;
+ }
+
+ /**
+ * java.lang.String
+ */
+
+ private String string0;
+
+ private String string1;
+
+ private void setString1(String s)
+ {
+ this.string1 = s;
+ }
+
+ /**
+ * Indicates whether handler is in correct state.
+ */
+ private boolean correctState;
+
+ // TODO: implement PreDestroy
+ @PostConstruct
+ private void init()
+ {
+ boolean correctInitialization = true;
+
+ // java.lang.Boolean
+ if (this.boolean0 != true)
+ {
+ log.error("@Resource initialization for boolean0 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean1 == null || this.boolean1 != true)
+ {
+ log.error("@Resource initialization for boolean1 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean2 != true)
+ {
+ log.error("@Resource initialization for boolean2 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean3 == null || this.boolean3 != true)
+ {
+ log.error("@Resource initialization for boolean3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Byte
+ if (this.byte0 != (byte)2)
+ {
+ log.error("@Resource initialization for byte0 failed");
+ correctInitialization = false;
+ }
+ if (this.byte1 == null || this.byte1 != (byte)2)
+ {
+ log.error("@Resource initialization for byte1 failed");
+ correctInitialization = false;
+ }
+ if (this.byte2 != (byte)2)
+ {
+ log.error("@Resource initialization for byte2 failed");
+ correctInitialization = false;
+ }
+ if (this.byte3 == null || this.byte3 != (byte)2)
+ {
+ log.error("@Resource initialization for byte3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Character
+ if (this.character0 != 'c')
+ {
+ log.error("@Resource initialization for character0 failed");
+ correctInitialization = false;
+ }
+ if (this.character1 == null || this.character1 != 'c')
+ {
+ log.error("@Resource initialization for character1 failed");
+ correctInitialization = false;
+ }
+ if (this.character2 != 'c')
+ {
+ log.error("@Resource initialization for character2 failed");
+ correctInitialization = false;
+ }
+ if (this.character3 == null || this.character3 != 'c')
+ {
+ log.error("@Resource initialization for character3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Short
+ if (this.short0 != (short)5)
+ {
+ log.error("@Resource initialization for short0 failed");
+ correctInitialization = false;
+ }
+ if (this.short1 == null || this.short1 != (short)5)
+ {
+ log.error("@Resource initialization for short1 failed");
+ correctInitialization = false;
+ }
+ if (this.short2 != (short)5)
+ {
+ log.error("@Resource initialization for short2 failed");
+ correctInitialization = false;
+ }
+ if (this.short3 == null || this.short3 != (short)5)
+ {
+ log.error("@Resource initialization for short3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Integer
+ if (this.integer0 != 7)
+ {
+ log.error("@Resource initialization for integer0 failed");
+ correctInitialization = false;
+ }
+ if (this.integer1 == null || this.integer1 != 7)
+ {
+ log.error("@Resource initialization for integer1 failed");
+ correctInitialization = false;
+ }
+ if (this.integer2 != 7)
+ {
+ log.error("@Resource initialization for integer2 failed");
+ correctInitialization = false;
+ }
+ if (this.integer3 == null || this.integer3 != 7)
+ {
+ log.error("@Resource initialization for integer3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Long
+ if (this.long0 != 11L)
+ {
+ log.error("@Resource initialization for long0 failed");
+ correctInitialization = false;
+ }
+ if (this.long1 == null || this.long1 != 11L)
+ {
+ log.error("@Resource initialization for long1 failed");
+ correctInitialization = false;
+ }
+ if (this.long2 != 11L)
+ {
+ log.error("@Resource initialization for long2 failed");
+ correctInitialization = false;
+ }
+ if (this.long3 == null || this.long3 != 11L)
+ {
+ log.error("@Resource initialization for long3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Float
+ if (this.float0 != 13.0f)
+ {
+ log.error("@Resource initialization for float0 failed");
+ correctInitialization = false;
+ }
+ if (this.float1 == null || this.float1 != 13.0f)
+ {
+ log.error("@Resource initialization for float1 failed");
+ correctInitialization = false;
+ }
+ if (this.float2 != 13.0f)
+ {
+ log.error("@Resource initialization for float2 failed");
+ correctInitialization = false;
+ }
+ if (this.float3 == null || this.float3 != 13.0f)
+ {
+ log.error("@Resource initialization for float3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Double
+ if (this.double0 != 17.0)
+ {
+ log.error("@Resource initialization for double0 failed");
+ correctInitialization = false;
+ }
+ if (this.double1 == null || this.double1 != 17.0)
+ {
+ log.error("@Resource initialization for double1 failed");
+ correctInitialization = false;
+ }
+ if (this.double2 != 17.0)
+ {
+ log.error("@Resource initialization for double2 failed");
+ correctInitialization = false;
+ }
+ if (this.double3 == null || this.double3 != 17.0)
+ {
+ log.error("@Resource initialization for double3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.String
+ if ("s".equals(this.string0) == false)
+ {
+ log.error("@Resource initialization for string0 failed");
+ correctInitialization = false;
+ }
+ if ("s".equals(this.string1) == false)
+ {
+ log.error("@Resource initialization for string1 failed");
+ correctInitialization = false;
+ }
+
+ this.correctState = correctInitialization;
+ }
+
+ @Override
+ public boolean handleOutbound(MessageContext msgContext)
+ {
+ return ensureInjectionsAndInitialization(msgContext, "Outbound");
+ }
+
+ @Override
+ public boolean handleInbound(MessageContext msgContext)
+ {
+ return ensureInjectionsAndInitialization(msgContext, "Inbound");
+ }
+
+ private boolean ensureInjectionsAndInitialization(MessageContext msgContext, String direction)
+ {
+ if (!this.correctState)
+ {
+ throw new WebServiceException("Unfunctional javax.annotation.* annotations");
+ }
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+ soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+ String oldValue = soapElement.getValue();
+ String newValue = oldValue + ":" + direction + ":DescriptorResourcesHandler";
+ soapElement.setValue(newValue);
+
+ log.debug("oldValue: " + oldValue);
+ log.debug("newValue: " + newValue);
+
+ return true;
+ }
+ catch (SOAPException ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/handler/JavaResourcesHandler.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,513 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.handler;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * This handler is initialized via injections.
+ * Injections are specified via @Resource annotation
+ * and refer to the ejb-jar.xml or web.xml defined
+ * environment entries.
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class JavaResourcesHandler extends GenericSOAPHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(JavaResourcesHandler.class);
+
+ /**
+ * java.lang.Boolean
+ */
+
+ @Resource(name = "boolean")
+ private boolean boolean0;
+
+ @Resource(name = "booleanWrapper")
+ private Boolean boolean1;
+
+ private boolean boolean2;
+
+ @Resource(name = "boolean")
+ private void setBoolean2(boolean b)
+ {
+ this.boolean2 = b;
+ }
+
+ private Boolean boolean3;
+
+ @Resource(name = "booleanWrapper")
+ private void setBoolean3(Boolean b)
+ {
+ this.boolean3 = b;
+ }
+
+ /**
+ * java.lang.Byte
+ */
+
+ @Resource(name = "byte")
+ private byte byte0;
+
+ @Resource(name = "byteWrapper")
+ private Byte byte1;
+
+ private byte byte2;
+
+ @Resource(name = "byte")
+ private void setByte2(byte b)
+ {
+ this.byte2 = b;
+ }
+
+ private Byte byte3;
+
+ @Resource(name = "byteWrapper")
+ private void setByte3(Byte b)
+ {
+ this.byte3 = b;
+ }
+
+ /**
+ * java.lang.Character
+ */
+
+ @Resource(name = "character")
+ private char character0;
+
+ @Resource(name = "characterWrapper")
+ private Character character1;
+
+ private char character2;
+
+ @Resource(name = "character")
+ private void setCharacter2(char c)
+ {
+ this.character2 = c;
+ }
+
+ private Character character3;
+
+ @Resource(name = "characterWrapper")
+ private void setCharacter3(Character c)
+ {
+ this.character3 = c;
+ }
+
+ /**
+ * java.lang.Short
+ */
+
+ @Resource(name = "short")
+ private short short0;
+
+ @Resource(name = "shortWrapper")
+ private Short short1;
+
+ private short short2;
+
+ @Resource(name = "short")
+ private void setShort2(short i)
+ {
+ this.short2 = i;
+ }
+
+ private Short short3;
+
+ @Resource(name = "shortWrapper")
+ private void setShort3(Short i)
+ {
+ this.short3 = i;
+ }
+
+ /**
+ * java.lang.Integer
+ */
+
+ @Resource(name = "integer")
+ private int integer0;
+
+ @Resource(name = "integerWrapper")
+ private Integer integer1;
+
+ private int integer2;
+
+ @Resource(name = "integer")
+ private void setInteger2(int i)
+ {
+ this.integer2 = i;
+ }
+
+ @Resource(name = "integerWrapper")
+ private Integer integer3;
+
+ private void setInteger3(Integer i)
+ {
+ this.integer3 = i;
+ }
+
+ /**
+ * java.lang.Long
+ */
+
+ @Resource(name = "long")
+ private long long0;
+
+ @Resource(name = "longWrapper")
+ private Long long1;
+
+ private long long2;
+
+ @Resource(name = "long")
+ private void setLong2(long l)
+ {
+ this.long2 = l;
+ }
+
+ private Long long3;
+
+ @Resource(name = "longWrapper")
+ private void setLong3(Long l)
+ {
+ this.long3 = l;
+ }
+
+ /**
+ * java.lang.Float
+ */
+
+ @Resource(name = "float")
+ private float float0;
+
+ @Resource(name = "floatWrapper")
+ private Float float1;
+
+ private float float2;
+
+ @Resource(name = "float")
+ private void setFloat2(float f)
+ {
+ this.float2 = f;
+ }
+
+ private Float float3;
+
+ @Resource(name = "floatWrapper")
+ private void setFloat3(Float f)
+ {
+ this.float3 = f;
+ }
+
+ /**
+ * java.lang.Double
+ */
+
+ @Resource(name = "double")
+ private double double0;
+
+ @Resource(name = "doubleWrapper")
+ private Double double1;
+
+ private double double2;
+
+ @Resource(name = "double")
+ private void setDouble2(double d)
+ {
+ this.double2 = d;
+ }
+
+ private Double double3;
+
+ @Resource(name = "doubleWrapper")
+ private void setDouble3(Double d)
+ {
+ this.double3 = d;
+ }
+
+ /**
+ * java.lang.String
+ */
+
+ @Resource(name = "string")
+ private String string0;
+
+ private String string1;
+
+ @Resource(name = "string")
+ private void setString1(String s)
+ {
+ this.string1 = s;
+ }
+
+ /**
+ * Indicates whether handler is in correct state.
+ */
+ private boolean correctState;
+
+ // TODO: implement PreDestroy
+ @PostConstruct
+ private void init()
+ {
+ boolean correctInitialization = true;
+
+ // java.lang.Boolean
+ if (this.boolean0 != true)
+ {
+ log.error("@Resource initialization for boolean0 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean1 == null || this.boolean1 != true)
+ {
+ log.error("@Resource initialization for boolean1 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean2 != true)
+ {
+ log.error("@Resource initialization for boolean2 failed");
+ correctInitialization = false;
+ }
+ if (this.boolean3 == null || this.boolean3 != true)
+ {
+ log.error("@Resource initialization for boolean3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Byte
+ if (this.byte0 != (byte)2)
+ {
+ log.error("@Resource initialization for byte0 failed");
+ correctInitialization = false;
+ }
+ if (this.byte1 == null || this.byte1 != (byte)2)
+ {
+ log.error("@Resource initialization for byte1 failed");
+ correctInitialization = false;
+ }
+ if (this.byte2 != (byte)2)
+ {
+ log.error("@Resource initialization for byte2 failed");
+ correctInitialization = false;
+ }
+ if (this.byte3 == null || this.byte3 != (byte)2)
+ {
+ log.error("@Resource initialization for byte3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Character
+ if (this.character0 != 'c')
+ {
+ log.error("@Resource initialization for character0 failed");
+ correctInitialization = false;
+ }
+ if (this.character1 == null || this.character1 != 'c')
+ {
+ log.error("@Resource initialization for character1 failed");
+ correctInitialization = false;
+ }
+ if (this.character2 != 'c')
+ {
+ log.error("@Resource initialization for character2 failed");
+ correctInitialization = false;
+ }
+ if (this.character3 == null || this.character3 != 'c')
+ {
+ log.error("@Resource initialization for character3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Short
+ if (this.short0 != (short)5)
+ {
+ log.error("@Resource initialization for short0 failed");
+ correctInitialization = false;
+ }
+ if (this.short1 == null || this.short1 != (short)5)
+ {
+ log.error("@Resource initialization for short1 failed");
+ correctInitialization = false;
+ }
+ if (this.short2 != (short)5)
+ {
+ log.error("@Resource initialization for short2 failed");
+ correctInitialization = false;
+ }
+ if (this.short3 == null || this.short3 != (short)5)
+ {
+ log.error("@Resource initialization for short3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Integer
+ if (this.integer0 != 7)
+ {
+ log.error("@Resource initialization for integer0 failed");
+ correctInitialization = false;
+ }
+ if (this.integer1 == null || this.integer1 != 7)
+ {
+ log.error("@Resource initialization for integer1 failed");
+ correctInitialization = false;
+ }
+ if (this.integer2 != 7)
+ {
+ log.error("@Resource initialization for integer2 failed");
+ correctInitialization = false;
+ }
+ if (this.integer3 == null || this.integer3 != 7)
+ {
+ log.error("@Resource initialization for integer3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Long
+ if (this.long0 != 11L)
+ {
+ log.error("@Resource initialization for long0 failed");
+ correctInitialization = false;
+ }
+ if (this.long1 == null || this.long1 != 11L)
+ {
+ log.error("@Resource initialization for long1 failed");
+ correctInitialization = false;
+ }
+ if (this.long2 != 11L)
+ {
+ log.error("@Resource initialization for long2 failed");
+ correctInitialization = false;
+ }
+ if (this.long3 == null || this.long3 != 11L)
+ {
+ log.error("@Resource initialization for long3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Float
+ if (this.float0 != 13.0f)
+ {
+ log.error("@Resource initialization for float0 failed");
+ correctInitialization = false;
+ }
+ if (this.float1 == null || this.float1 != 13.0f)
+ {
+ log.error("@Resource initialization for float1 failed");
+ correctInitialization = false;
+ }
+ if (this.float2 != 13.0f)
+ {
+ log.error("@Resource initialization for float2 failed");
+ correctInitialization = false;
+ }
+ if (this.float3 == null || this.float3 != 13.0f)
+ {
+ log.error("@Resource initialization for float3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.Double
+ if (this.double0 != 17.0)
+ {
+ log.error("@Resource initialization for double0 failed");
+ correctInitialization = false;
+ }
+ if (this.double1 == null || this.double1 != 17.0)
+ {
+ log.error("@Resource initialization for double1 failed");
+ correctInitialization = false;
+ }
+ if (this.double2 != 17.0)
+ {
+ log.error("@Resource initialization for double2 failed");
+ correctInitialization = false;
+ }
+ if (this.double3 == null || this.double3 != 17.0)
+ {
+ log.error("@Resource initialization for double3 failed");
+ correctInitialization = false;
+ }
+
+ // java.lang.String
+ if ("s".equals(this.string0) == false)
+ {
+ log.error("@Resource initialization for string0 failed");
+ correctInitialization = false;
+ }
+ if ("s".equals(this.string1) == false)
+ {
+ log.error("@Resource initialization for string1 failed");
+ correctInitialization = false;
+ }
+
+ this.correctState = correctInitialization;
+ }
+
+ @Override
+ public boolean handleOutbound(MessageContext msgContext)
+ {
+ return ensureInjectionsAndInitialization(msgContext, "Outbound");
+ }
+
+ @Override
+ public boolean handleInbound(MessageContext msgContext)
+ {
+ return ensureInjectionsAndInitialization(msgContext, "Inbound");
+ }
+
+ private boolean ensureInjectionsAndInitialization(MessageContext msgContext, String direction)
+ {
+ if (!this.correctState)
+ {
+ throw new WebServiceException("Unfunctional javax.annotation.* annotations");
+ }
+
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+ soapElement = (SOAPElement)soapElement.getChildElements().next();
+
+ String oldValue = soapElement.getValue();
+ String newValue = oldValue + ":" + direction + ":JavaResourcesHandler";
+ soapElement.setValue(newValue);
+
+ log.debug("oldValue: " + oldValue);
+ log.debug("newValue: " + newValue);
+
+ return true;
+ }
+ catch (SOAPException ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+}
\ No newline at end of file
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase1.client;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOIface;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2074] Resource injection in jaxws endpoints and handlers
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class JBWS2074TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2074TestCase.class, "jaxws-jbws2074-usecase1.war");
+ }
+
+ public void testUsecase1() throws Exception
+ {
+ String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-jbws2074-usecase1/Service";
+ QName serviceName = new QName("http://ws.jboss.org/jbws2074", "POJOService");
+ Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ POJOIface port = (POJOIface)service.getPort(POJOIface.class);
+
+ String retStr = port.echo("hello");
+
+ StringBuffer expStr = new StringBuffer("hello");
+ expStr.append(":Inbound:JavaResourcesHandler");
+ expStr.append(":Inbound:DescriptorResourcesHandler");
+ expStr.append(":POJOImpl");
+ expStr.append(":Outbound:DescriptorResourcesHandler");
+ expStr.append(":Outbound:JavaResourcesHandler");
+ assertEquals(expStr.toString(), retStr);
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOIface.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOIface.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOIface.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase1.service;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ name = "POJO",
+ targetNamespace = "http://ws.jboss.org/jbws2074"
+)
+public interface POJOIface
+{
+ String echo(String s);
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOImpl.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/POJOImpl.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase1.service;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+@WebService
+(
+ name = "POJO",
+ serviceName = "POJOService",
+ targetNamespace = "http://ws.jboss.org/jbws2074",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOIface"
+)
+@HandlerChain(file = "jaxws-service-handlers.xml")
+public class POJOImpl implements POJOIface
+{
+ private static Logger log = Logger.getLogger(POJOImpl.class);
+
+ @WebMethod
+ public String echo(String msg)
+ {
+ log.info("echo: " + msg);
+ return msg + ":POJOImpl";
+ }
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,22 @@
+<?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/samples/logicalhandler"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name>DescriptorResourcesHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+ <handler-chain>
+ <handler>
+ <handler-name>JavaResourcesHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase2.client;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Iface;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2074] Resource injection in jaxws endpoints and handlers
+ *
+ * @author ropalka(a)redhat.com
+ */
+public final class JBWS2074TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2074TestCase.class, "jaxws-jbws2074-usecase2.jar");
+ }
+
+ public void testUsecase1() throws Exception
+ {
+ String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-jbws2074-usecase2/Service";
+ QName serviceName = new QName("http://ws.jboss.org/jbws2074", "EJB3Service");
+ Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ EJB3Iface port = (EJB3Iface)service.getPort(EJB3Iface.class);
+
+ String retStr = port.echo("hello");
+
+ StringBuffer expStr = new StringBuffer("hello");
+ expStr.append(":Inbound:JavaResourcesHandler");
+ expStr.append(":Inbound:DescriptorResourcesHandler");
+ expStr.append(":EJB3Impl");
+ expStr.append(":Outbound:DescriptorResourcesHandler");
+ expStr.append(":Outbound:JavaResourcesHandler");
+ assertEquals(expStr.toString(), retStr);
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Iface.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Iface.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Iface.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase2.service;
+
+import javax.ejb.Remote;
+import javax.jws.WebService;
+
+@Remote
+@WebService
+(
+ name = "EJB3",
+ targetNamespace = "http://ws.jboss.org/jbws2074"
+)
+public interface EJB3Iface
+{
+ String echo(String s);
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Impl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Impl.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/EJB3Impl.java 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2074.usecase2.service;
+
+import javax.ejb.Stateless;
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@WebService
+(
+ name = "EJB3",
+ serviceName = "EJB3Service",
+ targetNamespace = "http://ws.jboss.org/jbws2074",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Iface"
+)
+@HandlerChain(file = "jaxws-service-handlers.xml")
+@WebContext
+(
+ urlPattern="/Service",
+ contextRoot="/jaxws-jbws2074-usecase2"
+)
+public class EJB3Impl implements EJB3Iface
+{
+ private static Logger log = Logger.getLogger(EJB3Impl.class);
+
+ public String echo(String msg)
+ {
+ log.info("echo: " + msg);
+ return msg + ":EJB3Impl";
+ }
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/jaxws-service-handlers.xml
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/jaxws-service-handlers.xml (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/service/jaxws-service-handlers.xml 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,22 @@
+<?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/samples/logicalhandler"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name>DescriptorResourcesHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+ <handler-chain>
+ <handler>
+ <handler-name>JavaResourcesHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/WEB-INF/web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase1/WEB-INF/web.xml 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <servlet>
+ <servlet-name>Service</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Service</servlet-name>
+ <url-pattern>/Service</url-pattern>
+ </servlet-mapping>
+
+ <env-entry>
+ <env-entry-name>boolean</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>boolean0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setBoolean2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>booleanWrapper</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>boolean1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setBoolean3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>byte</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>2</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>byte0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setByte2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>byteWrapper</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>2</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>byte1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setByte3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>character</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>c</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>character0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setCharacter2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>characterWrapper</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>c</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>character1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setCharacter3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>short</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>5</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>short0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setShort2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>shortWrapper</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>5</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>short1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setShort3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>integer</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>7</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>integer0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setInteger2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>integerWrapper</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>7</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>integer1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setInteger3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>long</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>11</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>long0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setLong2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>longWrapper</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>11</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>long1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setLong3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>float</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>13</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>float0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setFloat2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>floatWrapper</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>13</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>float1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setFloat3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>double</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>17</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>double0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setDouble2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>doubleWrapper</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>17</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>double1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setDouble3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>string</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>s</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>string0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setString1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+</web-app>
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml 2009-03-30 14:32:11 UTC (rev 9690)
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+
+ <enterprise-beans>
+ <session>
+
+ <ejb-name>EJB3Impl</ejb-name>
+
+ <env-entry>
+ <env-entry-name>boolean</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>boolean0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setBoolean2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>booleanWrapper</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>boolean1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setBoolean3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>byte</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>2</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>byte0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setByte2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>byteWrapper</env-entry-name>
+ <env-entry-type>java.lang.Byte</env-entry-type>
+ <env-entry-value>2</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>byte1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setByte3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>character</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>c</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>character0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setCharacter2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>characterWrapper</env-entry-name>
+ <env-entry-type>java.lang.Character</env-entry-type>
+ <env-entry-value>c</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>character1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setCharacter3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>short</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>5</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>short0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setShort2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>shortWrapper</env-entry-name>
+ <env-entry-type>java.lang.Short</env-entry-type>
+ <env-entry-value>5</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>short1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setShort3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>integer</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>7</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>integer0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setInteger2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>integerWrapper</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>7</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>integer1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setInteger3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>long</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>11</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>long0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setLong2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>longWrapper</env-entry-name>
+ <env-entry-type>java.lang.Long</env-entry-type>
+ <env-entry-value>11</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>long1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setLong3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>float</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>13</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>float0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setFloat2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>floatWrapper</env-entry-name>
+ <env-entry-type>java.lang.Float</env-entry-type>
+ <env-entry-value>13</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>float1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setFloat3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>double</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>17</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>double0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setDouble2</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>doubleWrapper</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>17</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>double1</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setDouble3</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ <env-entry>
+ <env-entry-name>string</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>s</env-entry-value>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>string0</injection-target-name>
+ </injection-target>
+ <injection-target>
+ <injection-target-class>
+ org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler</injection-target-class>
+ <injection-target-name>setString1</injection-target-name>
+ </injection-target>
+ </env-entry>
+
+ </session>
+ </enterprise-beans>
+
+</ejb-jar>
15 years, 9 months
JBossWS SVN: r9689 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/soap and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-03-30 10:16:54 -0400 (Mon, 30 Mar 2009)
New Revision: 9689
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/CustomHandler.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/JBWS2259TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Photo.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/attach.jpeg
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2259] Enable MTOM for incomming requests where the type of the content type is 'application/xop+xml'
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2009-03-27 21:55:54 UTC (rev 9688)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -165,6 +165,9 @@
CommonBinding binding = bindingProvider.getCommonBinding();
binding.setHeaderSource(delegate);
+ if (binding instanceof CommonSOAPBinding)
+ XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
+
// call the request handler chain
boolean handlersPass = callRequestHandlerChain(sepMetaData, handlerType[0]);
@@ -246,10 +249,7 @@
// Set the required outbound context properties
setOutboundContextProperties();
-
- if (binding instanceof CommonSOAPBinding)
- XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
-
+
// Bind the response message
MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData, sepInv);
msgContext.setMessageAbstraction(resMessage);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2009-03-27 21:55:54 UTC (rev 9688)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -255,6 +255,10 @@
inputStream = decoder.getRootPart().getDataHandler().getInputStream();
attachments = decoder.getRelatedParts();
+ if (isXOPContent(contentType))
+ {
+ soapMessage.setXOPMessage(true);
+ }
}
else if (isFastInfosetContent(contentType))
{
@@ -332,4 +336,10 @@
String baseType = type.getBaseType();
return MimeConstants.TYPE_MULTIPART_RELATED.equalsIgnoreCase(baseType);
}
+
+ private boolean isXOPContent(ContentType type)
+ {
+ String paramType = type.getParameter("type");
+ return MimeConstants.TYPE_APPLICATION_XOP_XML.endsWith(paramType);
+ }
}
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-03-27 21:55:54 UTC (rev 9688)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-03-30 14:16:54 UTC (rev 9689)
@@ -440,6 +440,19 @@
<include name="wsdl/*"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2259 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2259.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2259/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2259/Endpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2259/CustomHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2259/Photo.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2259/WEB-INF">
+ <include name="jaxws-endpoint-config.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-jbws2268 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2268.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2268/WEB-INF/web.xml">
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/CustomHandler.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/CustomHandler.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/CustomHandler.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2259;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * Test handker to test MTOM detection.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 27th March 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2259
+ */
+public class CustomHandler extends GenericSOAPHandler
+{
+ private static final Logger log = Logger.getLogger(CustomHandler.class);
+
+ public boolean handleMessage(final MessageContext msgContext)
+ {
+
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ soapMessage.writeTo(baos);
+ log.info("Wrote message.");
+ }
+ catch (Exception e)
+ {
+ throw new WSException("Unable to write message.", e);
+ }
+
+ return true;
+ }
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/CustomHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Endpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Endpoint.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Endpoint.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2259;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+
+/**
+ * Test Endpoint to test MTOM detection.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 27th March 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2259
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2259")
+@BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+public interface Endpoint
+{
+
+ public Photo echo(final Photo photo);
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2259;
+
+import java.awt.Image;
+import java.io.IOException;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.activation.DataHandler;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.annotation.EndpointConfig;
+
+/**
+ * Test Endpoint to test MTOM detection.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 27th March 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2259
+ */
+@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://ws.jboss.org/jbws2259", endpointInterface = "org.jboss.test.ws.jaxws.jbws2259.Endpoint")
+@EndpointConfig(configName = "Custom Client Config", configFile = "WEB-INF/jaxws-endpoint-config.xml")
+@BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+public class EndpointImpl implements Endpoint
+{
+
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public Photo echo(Photo photo)
+ {
+
+ DataHandler dh = photo.getImage();
+ String contentType = dh.getContentType();
+ log.info("Actual content-type " + contentType);
+ String expectedContentType = photo.getExpectedContentType();
+ log.info("Expected content-type " + expectedContentType);
+
+ if (expectedContentType.equals(contentType) == false)
+ {
+ throw new WSException("Expected content-type '" + expectedContentType + "' Actual content-type '" + contentType + "'");
+ }
+
+ try
+ {
+ Object content = dh.getContent();
+ log.info("Content - " + content.toString());
+ if (content instanceof Image == false)
+ {
+ throw new WSException("Unexpected content '" + content.getClass().getName() + "'");
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Unable to getContent()", e);
+ }
+
+ return photo;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/JBWS2259TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/JBWS2259TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/JBWS2259TestCase.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, 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.jbws2259;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.activation.FileDataSource;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test case to test MTOM detection.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 30th March 2009
+ * @see https://jira.jboss.org/jira/browse/JBWS-2259
+ */
+public class JBWS2259TestCase extends JBossWSTest
+{
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2259TestCase.class, "jaxws-jbws2259.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ if (port == null)
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2259?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws2259", "EndpointService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(Endpoint.class);
+
+ BindingProvider bindingProvider = (BindingProvider)port;
+ SOAPBinding soapBinding = (SOAPBinding)bindingProvider.getBinding();
+ soapBinding.setMTOMEnabled(true);
+ }
+ }
+
+ public void testCall() throws Exception
+ {
+ File sharkFile = getResourceFile("jaxws/jbws2259/attach.jpeg");
+ DataSource ds = new FileDataSource(sharkFile);
+ DataHandler handler = new DataHandler(ds);
+
+ String expectedContentType = "image/jpeg";
+
+ Photo p = new Photo();
+ p.setCaption("JBWS2259 Smile :-)");
+ p.setExpectedContentType(expectedContentType);
+ p.setImage(handler);
+
+ Photo reponse = port.echo(p);
+ DataHandler dhResponse = reponse.getImage();
+
+ String contentType = dhResponse.getContentType();
+ assertEquals("content-type", expectedContentType, contentType);
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/JBWS2259TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Photo.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Photo.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Photo.java 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2259;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+
+/**
+ * Representation of a photo to test marshalling.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 27th March 2009
+ */
+public class Photo
+{
+
+ private String caption;
+
+ private String expectedContentType;
+
+ private DataHandler image;
+
+ public String getCaption()
+ {
+ return caption;
+ }
+
+ public void setCaption(String caption)
+ {
+ this.caption = caption;
+ }
+
+ public String getExpectedContentType()
+ {
+ return expectedContentType;
+ }
+
+ public void setExpectedContentType(String expectedContentType)
+ {
+ this.expectedContentType = expectedContentType;
+ }
+
+ @XmlMimeType("*/*")
+ public DataHandler getImage()
+ {
+ return image;
+ }
+
+ public void setImage(DataHandler image)
+ {
+ this.image = image;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2259/Photo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <client-config>
+ <config-name>Custom Server Config</config-name>
+
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name> CustomHandler </javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws2259.CustomHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/web.xml 2009-03-30 14:16:54 UTC (rev 9689)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2259.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
+
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/attach.jpeg
===================================================================
(Binary files differ)
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2259/attach.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 9 months