Author: mageshbk(a)jboss.com
Date: 2009-07-28 09:54:43 -0400 (Tue, 28 Jul 2009)
New Revision: 10400
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
[JBWS-2708] XmlAttachmentRef annotation on List<DataHandler> is not identified as an
Attachment part - Added testcase
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java 2009-07-28
13:54:43 UTC (rev 10400)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class DocumentPayloadWithList
+{
+ @XmlElement
+ @XmlAttachmentRef
+ private List<DataHandler> data;
+
+ public DocumentPayloadWithList()
+ {
+ }
+
+ public List<DataHandler> getData()
+ {
+ if (data == null)
+ {
+ data = new ArrayList<DataHandler>();
+ }
+ return data;
+ }
+}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-07-28
11:36:39 UTC (rev 10399)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2009-07-28
13:54:43 UTC (rev 10400)
@@ -91,4 +91,17 @@
assertTrue(response.getData().getContent().equals("Server data"));
}
+
+ public void testListAnnotationWithWrapped() throws Exception
+ {
+ //[JBWS-2708]
+ Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"),
wrappedServiceQName);
+ WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(data);
+
+ DocumentPayloadWithList response = port.listAnnotation(payload, "Wrapped
test");
+ assertTrue(response.getData().get(0).getContent().equals("Server
data"));
+
+ }
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-07-28
11:36:39 UTC (rev 10399)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2009-07-28
13:54:43 UTC (rev 10400)
@@ -33,6 +33,9 @@
DocumentPayload beanAnnotation(DocumentPayload dhw, String test);
@WebMethod
+ DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test);
+
+ @WebMethod
@XmlAttachmentRef
DataHandler parameterAnnotation(DocumentPayload payload, String test,
@XmlAttachmentRef DataHandler data);
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-07-28
11:36:39 UTC (rev 10399)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2009-07-28
13:54:43 UTC (rev 10400)
@@ -75,7 +75,44 @@
return new DocumentPayload(dh);
}
+ @WebMethod
+ public DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String
test)
+ {
+ DataHandler dh;
+
+ try {
+ System.out.println("[TestServiceImpl] ---> Dans le service");
+ if (dhw != null && dhw.getData() != null && dhw.getData().get(0)
!= null) {
+ dh=dhw.getData().get(0);
+ dumpDH(dh);
+ }
+ else
+ {
+ System.out.println("[TestServiceImpl] ---> Le DataHandler est
NULL.");
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ dh = new DataHandler("Server data", "text/plain") ;
+
+ try{
+ System.out.println("[TestServiceImpl] ---> Le DataHandler
returned.");
+ dumpDH(dh);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ DocumentPayloadWithList payload = new DocumentPayloadWithList();
+ payload.getData().add(dh);
+
+ return payload;
+ }
+
+
@WebMethod
@XmlAttachmentRef
public DataHandler parameterAnnotation(DocumentPayload payload, String test,
@XmlAttachmentRef DataHandler data)