[jbossws-commits] JBossWS SVN: r10512 - framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Aug 10 10:23:29 EDT 2009


Author: mageshbk at jboss.com
Date: 2009-08-10 10:23:29 -0400 (Mon, 10 Aug 2009)
New Revision: 10512

Added:
   framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
Modified:
   framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
   framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
   framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
[JBPAPP-2341] - XmlAttachmentRef annotation on List<DataHandler> is not identified as an Attachment part - Testcase

Added: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java	                        (rev 0)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/DocumentPayloadWithList.java	2009-08-10 14:23:29 UTC (rev 10512)
@@ -0,0 +1,51 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt 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;
+
+ at 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/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java	2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java	2009-08-10 14:23:29 UTC (rev 10512)
@@ -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/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java	2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java	2009-08-10 14:23:29 UTC (rev 10512)
@@ -36,6 +36,9 @@
    DocumentPayload beanAnnotation(DocumentPayload dhw, String test) throws RemoteException;
 
    @WebMethod
+   DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test) throws RemoteException;
+
+   @WebMethod
    @XmlAttachmentRef
    DataHandler parameterAnnotation(DocumentPayload payload, String test, @XmlAttachmentRef DataHandler data) throws RemoteException;
 

Modified: framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
--- framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java	2009-08-10 13:46:55 UTC (rev 10511)
+++ framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java	2009-08-10 14:23:29 UTC (rev 10512)
@@ -76,7 +76,44 @@
       return new DocumentPayload(dh);
    }
 
+   @WebMethod
+   public DocumentPayloadWithList listAnnotation(DocumentPayloadWithList dhw, String test)  throws RemoteException
+   {
+      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) throws RemoteException



More information about the jbossws-commits mailing list