cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r776126 - in /cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/type/ main/java/org/apache/cxf/aegis/type/basic/ test/java/org/apache/cxf/aegis/ test/java/org/apache/cxf/aegis/integration/ test/java/org/apache/cxf/aegis/ser...
Date Mon, 18 May 2009 23:06:22 GMT
Author: bimargulies
Date: Mon May 18 23:06:22 2009
New Revision: 776126

URL: http://svn.apache.org/viewvc?rev=776126&view=rev
Log:
CXF-2224

Added:
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
  (with props)
Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.aegis.xml
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
Mon May 18 23:06:22 2009
@@ -119,7 +119,14 @@
         } else {
             Type type = getTypeMapping().getType(javaType);
             if (type == null) {
-                type = createDefaultType(info);
+                if (info.getTypeName() != null) {
+                    type = getTypeMapping().getType(info.getTypeName());
+                }
+                if (type == null) {
+                    type = createDefaultType(info);
+                } else {
+                    newType = false;
+                }
             } else {
                 newType = false;
             }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/XMLTypeCreator.java
Mon May 18 23:06:22 2009
@@ -260,7 +260,7 @@
 
         TypeClassInfo info = new TypeClassInfo();
         info.setTypeClass(pd.getReadMethod().getReturnType());
-        info.setDescription("property " + pd);
+        info.setDescription("property " + pd.getDisplayName());
         readMetadata(info, mapping, propertyEl);
 
         return info;

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Mon May 18 23:06:22 2009
@@ -509,7 +509,7 @@
         }
 
         /*
-         * Automagically add chain of superclassesif this is an an extension.
+         * Automagically add chain of superclasses if this is an an extension.
          */
         if (inf.isExtension()) {
             Type sooperType = getSuperType();

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/AbstractAegisTest.java
Mon May 18 23:06:22 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.aegis;
 
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -58,6 +59,7 @@
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -333,4 +335,12 @@
         this.enableJDOM = enableJDOM;
     }
     
+    protected String renderWsdl(Document wsdlDoc) throws XMLStreamException {
+        StringWriter out = new StringWriter();
+        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out);
+        StaxUtils.writeNode(wsdlDoc, writer, true);
+        writer.flush();
+        return out.toString();
+    }
+    
 }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/WrappedTest.java
Mon May 18 23:06:22 2009
@@ -27,6 +27,7 @@
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.services.ArrayService;
 import org.apache.cxf.aegis.services.BeanService;
+
 import org.junit.Before;
 import org.junit.Test;
 
@@ -37,6 +38,7 @@
 public class WrappedTest extends AbstractAegisTest {
     
     private ArrayService arrayService;
+    private Document arrayWsdlDoc;
     
     @Before 
     public void setUp() throws Exception {
@@ -45,6 +47,7 @@
         arrayService = new ArrayService();
         createService(BeanService.class, "BeanService");
         createService(ArrayService.class, arrayService, "Array", new QName("urn:Array", "Array"));
+        arrayWsdlDoc = getWSDLDocument("Array");
     }
     
     @Test
@@ -61,10 +64,25 @@
     
     @Test
     public void testArrayWsdl() throws Exception {
-        Document doc = getWSDLDocument("Array");
-        NodeList stuff = assertValid("//xsd:complexType[@name='ArrayOfString-2-50']", doc);
+        NodeList stuff = assertValid("//xsd:complexType[@name='ArrayOfString-2-50']", arrayWsdlDoc);
         assertEquals(1, stuff.getLength());
     }
+    
+    @Test
+    public void testXmlConfigurationOfParameterTypeSchema() throws Exception {
+        assertValid(
+                    "/wsdl:definitions/wsdl:types"
+                        + "/xsd:schema[@targetNamespace='urn:Array']"
+                        + "/xsd:complexType[@name=\"takeNumber\"]/xsd:sequence/xsd:element"
+                        + "[@type=\"xsd:long\"]",
+                    arrayWsdlDoc);
+    }
+    
+    @Test
+    public void testXmlConfigurationOfParameterType() throws Exception {
+        invoke("Array", "takeNumber.xml");
+        assertEquals(Long.valueOf(123456789), arrayService.getNumberValue());
+    }
 
     @Test
     public void testBeanServiceWSDL() throws Exception {

Added: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml?rev=776126&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
(added)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
Mon May 18 23:06:22 2009
@@ -0,0 +1,8 @@
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
+ <env:Header/>
+ <env:Body>
+  <takeNumber xmlns="urn:Array">
+  	<numberParam>123456789</numberParam>
+  </takeNumber>
+ </env:Body>
+</env:Envelope>
\ No newline at end of file

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/integration/takeNumber.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.aegis.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.aegis.xml?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.aegis.xml
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.aegis.xml
Mon May 18 23:06:22 2009
@@ -22,5 +22,8 @@
         <method name="submitStringArray">
             <parameter index="0" minOccurs='2' maxOccurs='50' nillable='false' />
         </method>
+        <method name="takeNumber" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+        	<parameter index="0" typeName="xsd:long"/>
+        </method>
     </mapping>
 </mappings>

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ArrayService.java
Mon May 18 23:06:22 2009
@@ -35,6 +35,10 @@
     private org.w3c.dom.Document[] w3cArray;
     private String beforeValue;
     private String afterValue;
+    private Number numberValue;
+    
+    public ArrayService() {
+    }
     
     @WebMethod
     public SimpleBean[] getBeanArray() {
@@ -93,6 +97,14 @@
     public org.w3c.dom.Document[] getW3cArray() {
         return w3cArray;
     }
+    
+    public void takeNumber(Number numberParam) {
+        numberValue = numberParam;
+    }
+    
+    public Number getNumberValue() {
+        return numberValue;
+    }
 
     public String getBeforeValue() {
         return beforeValue;

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.aegis.xml
Mon May 18 23:06:22 2009
@@ -20,5 +20,7 @@
 <mappings xmlns:stalk='urn:beanz'>
     <mapping name="stalk:SimpleBean">
     	<property name='numbers' nillable='false' minOccurs='2' maxOccurs='50' />
+    	<property name='number' typeName='xsd:long' xmlns:xsd="http://www.w3.org/2001/XMLSchema"
/>
     </mapping>
+    
 </mappings>
\ No newline at end of file

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/SimpleBean.java
Mon May 18 23:06:22 2009
@@ -34,6 +34,15 @@
     private char primitiveCharacter;
     private byte littleByte;
     private Byte bigByte;
+    private Number numberValue;
+    
+    public Number getNumber() {
+        return numberValue;
+    }
+    
+    public void setNumber(Number value) {
+        numberValue = value;
+    }
 
     public int[] getNumbers() {
         return numbers;

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java?rev=776126&r1=776125&r2=776126&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
Mon May 18 23:06:22 2009
@@ -487,7 +487,7 @@
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
         PropertyDescriptor[] pds = info.getPropertyDescriptors();
-        assertEquals(8, pds.length);
+        assertEquals(9, pds.length);
 
         ExtendedBean bean = new ExtendedBean();
         bean.setHowdy("howdy");



Mime
View raw message