cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r730862 [2/2] - in /cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/common/xmlschema/ common/common/src/main/java/org/apache/cxf/helpers/ rt/databinding/aegis/ rt/databinding/aegis/src/m...
Date Fri, 02 Jan 2009 23:10:35 GMT
Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapArrayType.java
Fri Jan  2 15:10:34 2009
@@ -25,7 +25,6 @@
 import java.util.List;
 import java.util.Set;
 import java.util.StringTokenizer;
-
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
@@ -40,7 +39,7 @@
 import org.apache.cxf.aegis.xml.MessageWriter;
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.helpers.CastUtils;
-import org.apache.ws.commons.schema.XmlSchema;
+import org.jdom.Element;
 
 import static org.apache.cxf.aegis.type.encoded.SoapEncodingUtil.readAttributeValue;
 
@@ -334,7 +333,7 @@
      * Throws UnsupportedOperationException
      */
     @Override
-    public void writeSchema(XmlSchema root) {
+    public void writeSchema(Element root) {
         throw new UnsupportedOperationException();
     }
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefType.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/encoded/SoapRefType.java
Fri Jan  2 15:10:34 2009
@@ -19,7 +19,6 @@
 package org.apache.cxf.aegis.type.encoded;
 
 import java.util.Set;
-
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.aegis.Context;
@@ -28,7 +27,7 @@
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
-import org.apache.ws.commons.schema.XmlSchema;
+import org.jdom.Element;
 
 /**
  * SoapRefType reads and writes SoapRef objects.
@@ -78,9 +77,8 @@
         SoapEncodingUtil.writeRef(writer, refId);
     }
 
-    @Override
-    public void writeSchema(XmlSchema schema) {
-        baseType.writeSchema(schema);
+    public void writeSchema(Element root) {
+        baseType.writeSchema(root);
     }
 
     public TypeMapping getTypeMapping() {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/EnumType.java
Fri Jan  2 15:10:34 2009
@@ -23,12 +23,10 @@
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
-import org.apache.cxf.common.xmlschema.XmlSchemaConstants;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet;
-import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
-import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
+import org.apache.cxf.common.util.SOAPConstants;
+import org.jdom.Attribute;
+import org.jdom.Element;
+import org.jdom.Namespace;
 
 public class EnumType extends Type {
     @SuppressWarnings("unchecked")
@@ -55,23 +53,23 @@
     }
 
     @Override
-    public void writeSchema(XmlSchema root) {
-        
-        XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root);
-        simple.setName(getSchemaType().getLocalPart());
-        root.addType(simple);
-        root.getItems().add(simple);
-        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
-        restriction.setBaseTypeName(XmlSchemaConstants.STRING_QNAME);
-        simple.setContent(restriction);
+    public void writeSchema(Element root) {
+        Namespace xsd = Namespace.getNamespace(SOAPConstants.XSD_PREFIX, SOAPConstants.XSD);
+
+        Element simple = new Element("simpleType", xsd);
+        simple.setAttribute(new Attribute("name", getSchemaType().getLocalPart()));
+        root.addContent(simple);
+
+        Element restriction = new Element("restriction", xsd);
+        restriction.setAttribute(new Attribute("base", SOAPConstants.XSD_PREFIX + ":string"));
+        simple.addContent(restriction);
 
         Object[] constants = getTypeClass().getEnumConstants();
 
-        XmlSchemaObjectCollection facets = restriction.getFacets();
         for (Object constant : constants) {
-            XmlSchemaEnumerationFacet f = new XmlSchemaEnumerationFacet();
-            f.setValue(((Enum)constant).name());
-            facets.add(f);
+            Element enumeration = new Element("enumeration", xsd);
+            enumeration.setAttribute(new Attribute("value", ((Enum)constant).name()));
+            restriction.addContent(enumeration);
         }
     }
 

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/mtom/AbstractXOPType.java
Fri Jan  2 15:10:34 2009
@@ -21,25 +21,23 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.basic.Base64Type;
 import org.apache.cxf.aegis.xml.MessageReader;
 import org.apache.cxf.aegis.xml.MessageWriter;
-import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.common.util.SOAPConstants;
 import org.apache.cxf.message.Attachment;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.constants.Constants;
+import org.jaxen.JaxenException;
+import org.jaxen.jdom.JDOMXPath;
+import org.jdom.Attribute;
+import org.jdom.Element;
+import org.jdom.Namespace;
 
 /**
  * Base class for MtoM types.
@@ -53,6 +51,18 @@
     public static final QName XML_MIME_CONTENT_TYPE = new QName(XML_MIME_NS, "contentType");
     public static final QName XOP_HREF = new QName("href");
     public static final QName XML_MIME_BASE64 = new QName(XML_MIME_NS, "base64Binary", "xmime");
+    private static JDOMXPath importXmimeXpath;
+    
+    static {
+        try {
+            importXmimeXpath = new JDOMXPath("xsd:import[@namespace='"
+                                             + XML_MIME_NS
+                                             + "']");
+            importXmimeXpath.addNamespace(SOAPConstants.XSD_PREFIX, SOAPConstants.XSD);
+        } catch (JaxenException e) {
+            throw new RuntimeException(e);
+        }
+    }
     
     private String expectedContentTypes;
     // the base64 type knows how to deal with just plain base64 here, which is essentially
always 
@@ -77,6 +87,10 @@
         }
     }
     
+    public static JDOMXPath getXmimeXpathImport() {
+        return importXmimeXpath;
+    }
+
     /**
      * This is called from base64Type when it recognizes an XOP attachment.
      * @param reader
@@ -194,13 +208,13 @@
     protected abstract byte[] getBytes(Object object);
 
     @Override
-    public void addToSchemaElement(XmlSchemaElement schemaElement) {
+    public void addToSchemaElement(Element schemaElement) {
         if (expectedContentTypes != null) {
-            Map<String, Node> extAttrMap = new HashMap<String, Node>();
-            Attr theAttr = DOMUtils.createDocument().createAttributeNS(XML_MIME_NS, "xmime");
-            theAttr.setNodeValue(expectedContentTypes);
-            extAttrMap.put("xmime", theAttr);
-            schemaElement.addMetaInfo(Constants.MetaDataConstants.EXTERNAL_ATTRIBUTES, extAttrMap);
+            Namespace ns = Namespace.getNamespace("xmime", XML_MIME_NS);
+            Attribute expectedContentTypeAttribute = new Attribute(XML_MIME_ATTR_LOCAL_NAME,

+                                                                   expectedContentTypes,
+                                                                   ns);
+            schemaElement.setAttribute(expectedContentTypeAttribute);
         }
     }
     

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/NamespaceHelper.java
Fri Jan  2 15:10:34 2009
@@ -20,6 +20,7 @@
 
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
 
@@ -29,11 +30,10 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.w3c.dom.Element;
-
 import org.apache.cxf.aegis.DatabindingException;
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.JavaUtils;
+import org.jdom.Element;
+import org.jdom.Namespace;
 
 /**
  * Namespace utilities.
@@ -62,17 +62,51 @@
                 return "";
             }
             prefix = getUniquePrefix(element);
-            DOMUtils.addNamespacePrefix(element, namespaceURI, prefix);
+            element.addNamespaceDeclaration(Namespace.getNamespace(prefix, namespaceURI));
         }
         return prefix;
     }
 
     public static String getPrefix(Element element, String namespaceURI) {
-        return DOMUtils.getPrefixRecursive(element, namespaceURI);
+        if (element.getNamespaceURI().equals(namespaceURI)) {
+            return element.getNamespacePrefix();
+        }
+
+        List namespaces = element.getAdditionalNamespaces();
+
+        for (Iterator itr = namespaces.iterator(); itr.hasNext();) {
+            Namespace ns = (Namespace)itr.next();
+
+            if (ns.getURI().equals(namespaceURI)) {
+                return ns.getPrefix();
+            }
+        }
+
+        if (element.getParentElement() != null) {
+            return getPrefix(element.getParentElement(), namespaceURI);
+        } else {
+            return null;
+        }
     }
 
     public static void getPrefixes(Element element, String namespaceURI, List<String>
prefixes) {
-        DOMUtils.getPrefixesRecursive(element, namespaceURI, prefixes);
+        if (element.getNamespaceURI().equals(namespaceURI)) {
+            prefixes.add(element.getNamespacePrefix());
+        }
+
+        List namespaces = element.getAdditionalNamespaces();
+
+        for (Iterator itr = namespaces.iterator(); itr.hasNext();) {
+            Namespace ns = (Namespace)itr.next();
+
+            if (ns.getURI().equals(namespaceURI)) {
+                prefixes.add(ns.getPrefix());
+            }
+        }
+
+        if (element.getParentElement() != null) {
+            getPrefixes(element.getParentElement(), namespaceURI, prefixes);
+        }
     }
 
     private static String getUniquePrefix(Element el) {
@@ -81,7 +115,7 @@
         while (true) {
             String nsPrefix = "ns" + n;
 
-            if (DOMUtils.getNamespace(el, nsPrefix) == null) {
+            if (el.getNamespace(nsPrefix) == null) {
                 return nsPrefix;
             }
 
@@ -339,15 +373,17 @@
 
         String prefix = value.substring(0, index);
         String localName = value.substring(index + 1);
-        String jNS = DOMUtils.getNamespace(e, prefix);
+        Namespace jNS = e.getNamespace(prefix);
         if (jNS == null) {
             throw new DatabindingException("No namespace was found for prefix: " + prefix);
         }
         
-        if (jNS == null || localName == null) {
+        String ns = jNS.getURI();
+
+        if (ns == null || localName == null) {
             throw new DatabindingException("Invalid QName in mapping: " + value);
         }
 
-        return new QName(jNS, localName, prefix);
+        return new QName(ns, localName, prefix);
     }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMNamespaceContext.java
Fri Jan  2 15:10:34 2009
@@ -24,6 +24,7 @@
 
 import javax.xml.namespace.NamespaceContext;
 
+import org.apache.cxf.aegis.util.NamespaceHelper;
 import org.jdom.Element;
 import org.jdom.Namespace;
 
@@ -40,12 +41,12 @@
     }
 
     public String getPrefix(String uri) {
-        return rawGetPrefix(element, uri);
+        return NamespaceHelper.getPrefix(element, uri);
     }
 
     public Iterator<String> getPrefixes(String uri) {
         List<String> prefixes = new ArrayList<String>();
-        rawGetPrefixes(element, uri, prefixes);
+        NamespaceHelper.getPrefixes(element, uri, prefixes);
         return prefixes.iterator();
     }
 
@@ -56,46 +57,4 @@
     public void setElement(Element element) {
         this.element = element;
     }
-    
-    public static String rawGetPrefix(Element element, String namespaceURI) {
-        if (element.getNamespaceURI().equals(namespaceURI)) {
-            return element.getNamespacePrefix();
-        }
-
-        List namespaces = element.getAdditionalNamespaces();
-
-        for (Iterator itr = namespaces.iterator(); itr.hasNext();) {
-            Namespace ns = (Namespace)itr.next();
-
-            if (ns.getURI().equals(namespaceURI)) {
-                return ns.getPrefix();
-            }
-        }
-
-        if (element.getParentElement() != null) {
-            return rawGetPrefix(element.getParentElement(), namespaceURI);
-        } else {
-            return null;
-        }
-    }
-    
-    static void rawGetPrefixes(Element element, String namespaceURI, List<String> prefixes)
{
-        if (element.getNamespaceURI().equals(namespaceURI)) {
-            prefixes.add(element.getNamespacePrefix());
-        }
-
-        List namespaces = element.getAdditionalNamespaces();
-
-        for (Iterator itr = namespaces.iterator(); itr.hasNext();) {
-            Namespace ns = (Namespace)itr.next();
-
-            if (ns.getURI().equals(namespaceURI)) {
-                prefixes.add(ns.getPrefix());
-            }
-        }
-
-        if (element.getParentElement() != null) {
-            rawGetPrefixes(element.getParentElement(), namespaceURI, prefixes);
-        }
-    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/util/stax/JDOMStreamWriter.java
Fri Jan  2 15:10:34 2009
@@ -26,6 +26,7 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.cxf.aegis.util.NamespaceHelper;
 import org.jdom.Attribute;
 import org.jdom.CDATA;
 import org.jdom.Comment;
@@ -183,7 +184,7 @@
     }
 
     public String getPrefix(String uri) throws XMLStreamException {
-        return JDOMNamespaceContext.rawGetPrefix(currentNode, uri);
+        return NamespaceHelper.getPrefix(currentNode, uri);
     }
 
     public void setPrefix(String arg0, String arg1) throws XMLStreamException {

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/xml/jdom/JDOMWriter.java
Fri Jan  2 15:10:34 2009
@@ -21,7 +21,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.cxf.aegis.util.stax.JDOMNamespaceContext;
+import org.apache.cxf.aegis.util.NamespaceHelper;
 import org.apache.cxf.aegis.xml.AbstractMessageWriter;
 import org.apache.cxf.aegis.xml.MessageWriter;
 import org.jdom.Attribute;
@@ -44,7 +44,7 @@
     }
 
     public void writeValue(Object value, String ns, String attr) {
-        String prefix = getUniquePrefix(element, ns);
+        String prefix = NamespaceHelper.getUniquePrefix(element, ns);
 
         element.setAttribute(new Attribute(attr, value.toString(), Namespace.getNamespace(prefix,
ns)));
     }
@@ -54,7 +54,7 @@
     }
 
     public MessageWriter getElementWriter(String name, String namespace) {
-        String prefix = getUniquePrefix(element, namespace);
+        String prefix = NamespaceHelper.getUniquePrefix(element, namespace);
 
         Element child = new Element(name, Namespace.getNamespace(prefix, namespace));
         element.addContent(child);
@@ -67,7 +67,7 @@
     }
 
     public String getPrefixForNamespace(String namespace) {
-        return getUniquePrefix(element, namespace);
+        return NamespaceHelper.getUniquePrefix(element, namespace);
     }
 
     public XMLStreamWriter getXMLStreamWriter() {
@@ -77,7 +77,7 @@
     public String getPrefixForNamespace(String namespace, String hint) {
         // todo: this goes for the option of ignoring the hint - we should
         // probably at least attempt to honour it
-        return getUniquePrefix(element, namespace);
+        return NamespaceHelper.getUniquePrefix(element, namespace);
     }
 
     public MessageWriter getAttributeWriter(String name) {
@@ -89,7 +89,7 @@
     public MessageWriter getAttributeWriter(String name, String namespace) {
         Attribute att;
         if (namespace != null && namespace.length() > 0) {
-            String prefix = getUniquePrefix(element, namespace);
+            String prefix = NamespaceHelper.getUniquePrefix(element, namespace);
             att = new Attribute(name, "", Namespace.getNamespace(prefix, namespace));
         } else {
             att = new Attribute(name, "");
@@ -105,32 +105,4 @@
 
     public void close() {
     }
-    
-    private static String getUniquePrefix(Element el) {
-        int n = 1;
-
-        while (true) {
-            String nsPrefix = "ns" + n;
-
-            if (el.getNamespace(nsPrefix) == null) {
-                return nsPrefix;
-            }
-
-            n++;
-        }
-    }
-    
-    private static String getUniquePrefix(Element element, String namespaceURI) {
-        String prefix = JDOMNamespaceContext.rawGetPrefix(element, namespaceURI);
-
-        // it is OK to have both namespace URI and prefix be empty. 
-        if (prefix == null) {
-            if ("".equals(namespaceURI)) {
-                return "";
-            }
-            prefix = getUniquePrefix(element);
-            element.addNamespaceDeclaration(Namespace.getNamespace(prefix, namespaceURI));
-        }
-        return prefix;
-    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/CustomMappingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/CustomMappingTest.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/CustomMappingTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/custom/CustomMappingTest.java
Fri Jan  2 15:10:34 2009
@@ -27,8 +27,7 @@
 import org.apache.cxf.aegis.type.TypeMapping;
 import org.apache.cxf.aegis.type.basic.BeanType;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
-import org.apache.ws.commons.schema.XmlSchema;
-
+import org.jdom.Element;
 import org.junit.Test;
 
 /**
@@ -45,9 +44,8 @@
         TypeMapping mapping = context.getTypeMapping();
         // we are replacing the default mapping.
         mapping.register(beanType);
-        XmlSchema schema = new XmlSchema();
-        beanType.writeSchema(schema);
-        // well, test?
+        Element root = new Element("dummySchema");
+        beanType.writeSchema(root);
     }
 
 }

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=730862&r1=730861&r2=730862&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
Fri Jan  2 15:10:34 2009
@@ -25,6 +25,9 @@
 
 import javax.xml.namespace.QName;
 
+import org.w3c.dom.Attr;
+import org.w3c.dom.NodeList;
+
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.AegisContext;
 import org.apache.cxf.aegis.Context;
@@ -38,13 +41,6 @@
 import org.apache.cxf.aegis.xml.stax.ElementReader;
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.util.SOAPConstants;
-import org.apache.cxf.common.xmlschema.XmlSchemaConstants;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaAttribute;
-import org.apache.ws.commons.schema.XmlSchemaComplexType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaObject;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.jdom.Document;
 import org.jdom.Element;
 import org.junit.Test;
@@ -166,7 +162,7 @@
         assertInvalid("/b:root/b:bleh", element);
         assertValid("/b:root/b:howdycustom[text()='howdy']", element);
     }
-    
+
     @Test
     public void testAttributeMap() throws Exception {
         BeanTypeInfo info = new BeanTypeInfo(SimpleBean.class, "urn:Bean");
@@ -194,27 +190,17 @@
 
         assertValid("/b:root[@b:bleh='bleh']", element);
         assertValid("/b:root[@b:howdy='howdy']", element);
-        
-        XmlSchema schema = new XmlSchema();
+
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType stype = (XmlSchemaComplexType)schema.getTypeByName("bean");
-        boolean howdy = false;
-        boolean bleh = false;
-        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
-            XmlSchemaObject o = stype.getAttributes().getItem(x);
-            if (o instanceof XmlSchemaAttribute) {
-                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
-                if ("howdy".equals(a.getName())) {
-                    howdy = true;
-                }
-                if ("bleh".equals(a.getName())) {
-                    bleh = true;
-                }
-            }
-        }
-        assertTrue(howdy);
-        assertTrue(bleh);
+
+        assertValid("//xsd:complexType[@name='bean']/xsd:attribute[@name='howdy']", schema);
+        assertValid("//xsd:complexType[@name='bean']/xsd:attribute[@name='bleh']", schema);
     }
 
     @Test
@@ -278,36 +264,16 @@
         assertInvalid("/b:root[@b:howdy]", element);
         assertValid("/b:root/b:bleh[@xsi:nil='true']", element);
 
-        XmlSchema schema = new XmlSchema();
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType stype = (XmlSchemaComplexType)schema.getTypeByName("bean");
-        XmlSchemaSequence seq = (XmlSchemaSequence) stype.getParticle();
-        boolean howdy = false;
-        boolean bleh = false;
-
-        for (int x = 0; x < seq.getItems().getCount(); x++) {
-            XmlSchemaObject o = seq.getItems().getItem(x);
-            if (o instanceof XmlSchemaElement) {
-                XmlSchemaElement a = (XmlSchemaElement)o;
-                if ("bleh".equals(a.getName())) {
-                    bleh = true;
-                }
-            }
-        }
-
-        for (int x = 0; x < stype.getAttributes().getCount(); x++) {
-            XmlSchemaObject o = stype.getAttributes().getItem(x);
-            if (o instanceof XmlSchemaAttribute) {
-                XmlSchemaAttribute a = (XmlSchemaAttribute)o;
-                if ("howdy".equals(a.getName())) {
-                    howdy = true;
-                }
-            }
-        }
 
-        assertTrue(howdy);
-        assertTrue(bleh);
+        assertValid("//xsd:complexType[@name='bean']/xsd:attribute[@name='howdy']", schema);
+        assertValid("//xsd:complexType[@name='bean']/xsd:sequence/xsd:element[@name='bleh']",
schema);
     }
     
     @Test
@@ -320,30 +286,22 @@
         type.setTypeMapping(mapping);
         type.setSchemaType(new QName("urn:Bean", "bean"));
 
-        XmlSchema schema = new XmlSchema();
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("bean");
-        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
-        boolean int1ok = false;
-        boolean int2ok = false;
-        for (int x = 0; x < seq.getItems().getCount(); x++) {
-            XmlSchemaObject o = seq.getItems().getItem(x);
-            if (o instanceof XmlSchemaElement) {
-                XmlSchemaElement oe = (XmlSchemaElement) o;
-                if ("int1".equals(oe.getName())) {
-                    int1ok = true;
-                    assertTrue(oe.isNillable());
-                    assertEquals(0, oe.getMinOccurs());
-                } else if ("int2".equals(oe.getName())) {
-                    int2ok = true;
-                    assertEquals(0, oe.getMinOccurs());
-                    assertFalse(oe.isNillable());
-                }
-            }
-        }
-        assertTrue(int1ok);
-        assertTrue(int2ok);
+
+        assertValid("//xsd:complexType[@name='bean']/xsd:sequence/xsd:element[@name='int1']"
+                    + "[@nillable='true'][@minOccurs='0']",
+                    schema);
+        assertValid("//xsd:complexType[@name='bean']/xsd:sequence/xsd:element[@name='int2'][@minOccurs='0']",
+                    schema);
+        assertInvalid("//xsd:complexType[@name='bean']/xsd:sequence"
+                        + "/xsd:element[@name='int2'][@nillable='true']",
+                      schema);
     }
     @Test
     public void testNillableIntMinOccurs1() throws Exception {
@@ -360,24 +318,20 @@
         type.setTypeClass(IntBean.class);
         type.setTypeMapping(mapping);
 
-        XmlSchema schema = new XmlSchema();
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("IntBean");
-        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
-        boolean int1ok = false;
-        for (int x = 0; x < seq.getItems().getCount(); x++) {
-            XmlSchemaObject o = seq.getItems().getItem(x);
-            if (o instanceof XmlSchemaElement) {
-                XmlSchemaElement oe = (XmlSchemaElement) o;
-                if ("int1".equals(oe.getName())) {
-                    int1ok = true;
-                    assertFalse(oe.isNillable());
-                    assertEquals(1, oe.getMinOccurs());
-                } 
-            }
-        }
-        assertTrue(int1ok);
+
+        assertValid("//xsd:complexType[@name='IntBean']/xsd:sequence/xsd:element[@name='int1']",
schema);
+        assertInvalid(
+                      "//xsd:complexType[@name='IntBean']/xsd:sequence/xsd:element[@name='int1'][@minOccurs]",
+                      schema);
+        assertInvalid("//xsd:complexType[@name='IntBean']/xsd:sequence/xsd:element[@name='int1'][@nillable]",
+                      schema);
     }
     
     @Test
@@ -389,28 +343,25 @@
         BeanType type = (BeanType)mapping.getTypeCreator().createType(SimpleBean.class);
         type.setTypeClass(SimpleBean.class);
         type.setTypeMapping(mapping);
-        
-        XmlSchema schema = new XmlSchema();
+
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("SimpleBean");
-        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
-        boolean charok = false;
-
-        for (int x = 0; x < seq.getItems().getCount(); x++) {
-            XmlSchemaObject o = seq.getItems().getItem(x);
-            if (o instanceof XmlSchemaElement) {
-                XmlSchemaElement oe = (XmlSchemaElement) o;
-                if ("character".equals(oe.getName())) {
-                    charok = true;
-                    assertNotNull(oe.getSchemaTypeName());
-                    assertTrue(oe.isNillable());
-                    assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME, 
-                                 oe.getSchemaTypeName());
-                }
-            }
-        }
-        assertTrue(charok);
+
+        NodeList typeAttrNode = 
+            assertValid("//xsd:complexType[@name='SimpleBean']/xsd:sequence/xsd:element[@name='character']"
+                       + "/@type", 
+                       schema); 
+        assertEquals(1, typeAttrNode.getLength());
+        Attr typeAttr = (Attr)typeAttrNode.item(0);
+        String typeQnameString = typeAttr.getValue();
+        String[] pieces = typeQnameString.split(":");
+        assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME.getLocalPart(),
+                     pieces[1]);
     }
     
     @Test
@@ -423,33 +374,35 @@
         type.setTypeClass(SimpleBean.class);
         type.setTypeMapping(mapping);
 
-        XmlSchema schema = new XmlSchema();
+        Element types = new Element("types", "xsd", SOAPConstants.XSD);
+        Element schema = new Element("schema", "xsd", SOAPConstants.XSD);
+        types.addContent(schema);
+
+        new Document(types);
+
         type.writeSchema(schema);
-        
-        XmlSchemaComplexType btype = (XmlSchemaComplexType)schema.getTypeByName("SimpleBean");
-        XmlSchemaSequence seq = (XmlSchemaSequence)btype.getParticle();
-        boolean littleByteOk = false;
-        boolean bigByteOk = false;
-
-        for (int x = 0; x < seq.getItems().getCount(); x++) {
-            XmlSchemaObject o = seq.getItems().getItem(x);
-            if (o instanceof XmlSchemaElement) {
-                XmlSchemaElement oe = (XmlSchemaElement) o;
-                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());
-                }
-            }
-        }
-        assertTrue(littleByteOk);
-        assertTrue(bigByteOk);
+
+        NodeList typeAttrNode = 
+            assertValid("//xsd:complexType[@name='SimpleBean']/xsd:sequence/xsd:element[@name='littleByte']"
+                       + "/@type", 
+                       schema); 
+        assertEquals(1, typeAttrNode.getLength());
+        Attr typeAttr = (Attr)typeAttrNode.item(0);
+        String typeQnameString = typeAttr.getValue();
+        String[] pieces = typeQnameString.split(":");
+        assertEquals("xsd", pieces[0]);
+        assertEquals("byte", pieces[1]);
+        
+        typeAttrNode = 
+            assertValid("//xsd:complexType[@name='SimpleBean']/xsd:sequence/xsd:element[@name='bigByte']"
+                       + "/@type", 
+                       schema); 
+        assertEquals(1, typeAttrNode.getLength());
+        typeAttr = (Attr)typeAttrNode.item(0);
+        typeQnameString = typeAttr.getValue();
+        pieces = typeQnameString.split(":");
+        assertEquals("xsd", pieces[0]);
+        assertEquals("byte", pieces[1]);
         
         Element element = new Element("root", "b", "urn:Bean");
         new Document(element);
@@ -557,21 +510,21 @@
         type.setTypeMapping(mapping);
         type.setSchemaType(new QName("urn:foo", "BadBean"));
 
-        assertTrue(type.getTypeInfo().getElements().iterator().hasNext());
+        assertTrue(type.getTypeInfo().getElements().hasNext());
 
         type = new BeanType();
         type.setTypeClass(BadBean.class);
         type.setTypeMapping(mapping);
         type.setSchemaType(new QName("urn:foo", "BadBean"));
 
-        assertFalse(type.getTypeInfo().getElements().iterator().hasNext());
+        assertFalse(type.getTypeInfo().getElements().hasNext());
 
         type = new BeanType();
         type.setTypeClass(BadBean2.class);
         type.setTypeMapping(mapping);
         type.setSchemaType(new QName("urn:foo", "BadBean2"));
 
-        assertFalse(type.getTypeInfo().getElements().iterator().hasNext());
+        assertFalse(type.getTypeInfo().getElements().hasNext());
     }
 
     public static class DateBean {

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/AnnotatedTypeTest.java
Fri Jan  2 15:10:34 2009
@@ -64,7 +64,7 @@
         AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, AnnotatedBean1.class, "urn:foo",
                                                        new TypeCreationOptions());
 
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
@@ -91,7 +91,7 @@
             fail("Unexpected element name: " + element.getLocalPart());
         }
 
-        Iterator atts = info.getAttributes().iterator();
+        Iterator atts = info.getAttributes();
         assertTrue(atts.hasNext());
         atts.next();
         assertFalse(atts.hasNext());
@@ -104,9 +104,9 @@
     public void testAegisType() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(AnnotatedBean3.class);
 
-        assertEquals(0, type.getTypeInfo().getAttributes().size());
+        assertFalse(type.getTypeInfo().getAttributes().hasNext());
 
-        Iterator itr = type.getTypeInfo().getElements().iterator();
+        Iterator itr = type.getTypeInfo().getElements();
         assertTrue(itr.hasNext());
         QName q = (QName)itr.next();
         assertEquals("attProp", q.getLocalPart());
@@ -124,7 +124,7 @@
     public void testNillableAndMinOccurs() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(AnnotatedBean4.class);
         AnnotatedTypeInfo info = (AnnotatedTypeInfo)type.getTypeInfo();
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         // nillable first
         QName element = (QName)elements.next();
@@ -177,7 +177,7 @@
                                                            new TypeCreationOptions()));
         type.setSchemaType(new QName("urn:foo", "BadBean"));
 
-        assertFalse(type.getTypeInfo().getElements().iterator().hasNext());
+        assertFalse(type.getTypeInfo().getElements().hasNext());
     }
 
     public static class BadBean {

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Fri Jan  2 15:10:34 2009
@@ -30,10 +30,8 @@
 import org.apache.cxf.aegis.xml.jdom.JDOMReader;
 import org.apache.cxf.aegis.xml.jdom.JDOMWriter;
 import org.apache.cxf.common.util.SOAPConstants;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaSerializer;
 import org.jdom.Element;
-
+import org.jdom.output.DOMOutputter;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -120,11 +118,12 @@
         EnumType type = new EnumType();
         type.setTypeClass(smallEnum.class);
         type.setSchemaType(new QName("urn:test", "test"));
-        XmlSchema schema = new XmlSchema();
-        type.writeSchema(schema);
 
-        XmlSchemaSerializer ser = new XmlSchemaSerializer();
-        Document doc = ser.serializeSchema(schema, false)[0];
+        Element root = new Element("root");
+        org.jdom.Document wsdl = new org.jdom.Document(root);
+        type.writeSchema(root);
+
+        Document doc = new DOMOutputter().output(wsdl);
         addNamespace("xsd", SOAPConstants.XSD);
         assertValid("//xsd:simpleType[@name='test']/xsd:restriction[@base='xsd:string']",
doc);
         assertValid("//xsd:restriction[@base='xsd:string']/xsd:enumeration[@value='VALUE1']",
doc);

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/JaxbTypeTest.java
Fri Jan  2 15:10:34 2009
@@ -64,7 +64,7 @@
         AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, JaxbBean1.class, "urn:foo",
                                                        new TypeCreationOptions());
 
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
@@ -91,7 +91,7 @@
             fail("Unexpected element name: " + element.getLocalPart());
         }
 
-        Iterator atts = info.getAttributes().iterator();
+        Iterator atts = info.getAttributes();
         assertTrue(atts.hasNext());
         atts.next();
         assertFalse(atts.hasNext());
@@ -104,9 +104,9 @@
     public void testAegisType() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(JaxbBean3.class);
 
-        assertEquals(0, type.getTypeInfo().getAttributes().size());
+        assertFalse(type.getTypeInfo().getAttributes().hasNext());
 
-        Iterator itr = type.getTypeInfo().getElements().iterator();
+        Iterator itr = type.getTypeInfo().getElements();
         assertTrue(itr.hasNext());
         QName q = (QName)itr.next();
         assertEquals("attProp", q.getLocalPart());
@@ -124,7 +124,7 @@
     public void testNillableAndMinOccurs() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(JaxbBean4.class);
         AnnotatedTypeInfo info = (AnnotatedTypeInfo)type.getTypeInfo();
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         // nillable first
         QName element = (QName)elements.next();
@@ -177,7 +177,7 @@
                                                            new TypeCreationOptions()));
         type.setSchemaType(new QName("urn:foo", "BadBean"));
 
-        assertEquals(0, type.getTypeInfo().getElements().size());
+        assertFalse(type.getTypeInfo().getElements().hasNext());
     }
 
     public static class BadBean {

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java?rev=730862&r1=730861&r2=730862&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireTypeTest.java
Fri Jan  2 15:10:34 2009
@@ -64,7 +64,7 @@
         AnnotatedTypeInfo info = new AnnotatedTypeInfo(tm, XFireBean1.class, "urn:foo",
                                                        new TypeCreationOptions());
 
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         QName element = (QName)elements.next();
         assertTrue(elements.hasNext());
@@ -91,7 +91,7 @@
             fail("Unexpected element name: " + element.getLocalPart());
         }
 
-        Iterator atts = info.getAttributes().iterator();
+        Iterator atts = info.getAttributes();
         assertTrue(atts.hasNext());
         atts.next();
         assertFalse(atts.hasNext());
@@ -104,9 +104,9 @@
     public void testAegisType() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(XFireBean3.class);
 
-        assertEquals(0, type.getTypeInfo().getAttributes().size());
+        assertFalse(type.getTypeInfo().getAttributes().hasNext());
 
-        Iterator itr = type.getTypeInfo().getElements().iterator();
+        Iterator itr = type.getTypeInfo().getElements();
         assertTrue(itr.hasNext());
         QName q = (QName)itr.next();
         assertEquals("attProp", q.getLocalPart());
@@ -124,7 +124,7 @@
     public void testNillableAndMinOccurs() {
         BeanType type = (BeanType)tm.getTypeCreator().createType(XFireBean4.class);
         AnnotatedTypeInfo info = (AnnotatedTypeInfo)type.getTypeInfo();
-        Iterator elements = info.getElements().iterator();
+        Iterator elements = info.getElements();
         assertTrue(elements.hasNext());
         // nillable first
         QName element = (QName)elements.next();
@@ -177,7 +177,7 @@
                                                            new TypeCreationOptions()));
         type.setSchemaType(new QName("urn:foo", "BadBean"));
 
-        assertEquals(0, type.getTypeInfo().getElements().size());
+        assertFalse(type.getTypeInfo().getElements().hasNext());
     }
 
     public static class BadBean {



Mime
View raw message