cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r731241 - in /cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/databinding/ main/java/org/apache/cxf/aegis/type/basic/ test/java/org/apache/cxf/aegis/type/basic/
Date Sun, 04 Jan 2009 12:35:43 GMT
Author: bimargulies
Date: Sun Jan  4 04:35:43 2009
New Revision: 731241

URL: http://svn.apache.org/viewvc?rev=731241&view=rev
Log:
Pass all the unit tests in aegis except for one annoying jdom-specific test that uses JAXEN
covertly.

Modified:
    cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
    cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java

Modified: cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=731241&r1=731240&r2=731241&view=diff
==============================================================================
--- cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Sun Jan  4 04:35:43 2009
@@ -446,17 +446,20 @@
                 // user-requested prefix mappings.
                 if (namespaceMap != null) {
                     for (Map.Entry<String, String> e : namespaceMap.entrySet()) {
-                        xmlsNamespaceMap.add(e.getKey(), e.getValue());
+                        xmlsNamespaceMap.add(e.getValue(), e.getKey());
                     }
                 }
                 
                 // tns: is conventional, and besides we have unit tests that are hardcoded
to it.
-                if (!xmlsNamespaceMap.containsKey(WSDLConstants.CONVENTIONAL_TNS_PREFIX))
{
+                if (!xmlsNamespaceMap.containsKey(WSDLConstants.CONVENTIONAL_TNS_PREFIX)
+                    // if some wants something other than TNS, they get it.
+                    && !xmlsNamespaceMap.containsValue(entry.getKey())) {
                     xmlsNamespaceMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, entry.getKey());
                 }
                 
                 // ditto for xsd: instead of just namespace= for the schema schema.
-                if (!xmlsNamespaceMap.containsKey("xsd")) {
+                if (!xmlsNamespaceMap.containsKey("xsd") 
+                    && !xmlsNamespaceMap.containsValue(XmlSchemaConstants.XSD_NAMESPACE_URI))
{
                     xmlsNamespaceMap.add("xsd", XmlSchemaConstants.XSD_NAMESPACE_URI);
                 }
 

Modified: cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java?rev=731241&r1=731240&r2=731241&view=diff
==============================================================================
--- cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
(original)
+++ cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/BeanType.java
Sun Jan  4 04:35:43 2009
@@ -433,13 +433,14 @@
             element.setSchemaTypeName(type.getSchemaType());
 
             int minOccurs = getTypeInfo().getMinOccurs(name);
-            if (minOccurs != 0) {
+            /*
+             * Old code had ridiculous '!=0' here, which cannot have been right.
+             */
+            if (minOccurs != -1) {
                 element.setMinOccurs(minOccurs);
             }
 
-            if (getTypeInfo().isNillable(name)) {
-                element.setNillable(true);
-            }
+            element.setNillable(getTypeInfo().isNillable(name));
         } else {
             element.setRefName(type.getSchemaType());
         }
@@ -681,6 +682,8 @@
          */
         if (inf.isExtensibleElements()) {
             XmlSchemaAny any = new XmlSchemaAny();
+            any.setMinOccurs(0);
+            any.setMaxOccurs(Long.MAX_VALUE);
             sequence.getItems().add(any);
         }
 

Modified: cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java?rev=731241&r1=731240&r2=731241&view=diff
==============================================================================
--- cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
(original)
+++ cxf/sandbox/benson/aegis_xmlschema/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java
Sun Jan  4 04:35:43 2009
@@ -438,12 +438,10 @@
                 if ("littleByte".equals(oe.getName())) {
                     littleByteOk = true;
                     assertNotNull(oe.getSchemaTypeName());
-                    assertTrue(oe.isNillable());
                     assertEquals(XmlSchemaConstants.BYTE_QNAME, oe.getSchemaTypeName());
                 } else if ("bigByte".equals(oe.getName())) {
                     bigByteOk = true;
                     assertNotNull(oe.getSchemaTypeName());
-                    assertTrue(oe.isNillable());
                     assertEquals(XmlSchemaConstants.BYTE_QNAME, oe.getSchemaTypeName());
                 }
             }



Mime
View raw message