cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1489597 - in /cxf/branches/dkulp-nowsdl4j: api/src/main/java/org/apache/cxf/common/jaxb/ api/src/main/java/org/apache/cxf/common/util/ rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/ rt/bindings/xml/src/main/java/org/apache/cxf/b...
Date Tue, 04 Jun 2013 20:52:30 GMT
Author: dkulp
Date: Tue Jun  4 20:52:14 2013
New Revision: 1489597

URL: http://svn.apache.org/r1489597
Log:
Start getting some of the tooling tests passing
Use ASM to create javax.wsdl versions of the types if they are needed

Modified:
    cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
    cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/ASMHelper.java
    cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFormatValidator.java
    cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/wsdl11/XmlIoPlugin.java
    cxf/branches/dkulp-nowsdl4j/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPWSDLExtensionLoader.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/pom.xml
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
    cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
    cxf/branches/dkulp-nowsdl4j/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java

Modified: cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
Tue Jun  4 20:52:14 2013
@@ -146,9 +146,11 @@ public final class JAXBContextCache {  
         JAXBUtils.scanPackages(classes, OBJECT_FACTORY_CACHE);
     }
     
-    public static CachedContextAndSchemas getCachedContextAndSchemas(Class<?> cls)
throws JAXBException {
+    public static CachedContextAndSchemas getCachedContextAndSchemas(Class<?> ... cls)
throws JAXBException {
         Set<Class<?>> classes = new HashSet<Class<?>>();
-        classes.add(cls);
+        for (Class<?> c : cls) {
+            classes.add(c);
+        }
         scanPackages(classes);
         return JAXBContextCache.getCachedContextAndSchemas(classes, null, null, null, false);
     }

Modified: cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/ASMHelper.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/ASMHelper.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/ASMHelper.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/ASMHelper.java
Tue Jun  4 20:52:14 2013
@@ -153,7 +153,7 @@ public class ASMHelper {
         return buf.toString();
     }
     
-    protected static String periodToSlashes(String s) {
+    public static String periodToSlashes(String s) {
         char ch[] = s.toCharArray();
         for (int x = 0; x < ch.length; x++) {
             if (ch[x] == '.') {
@@ -433,6 +433,9 @@ public class ASMHelper {
         void visitFieldInsn(int getfield, String periodToSlashes,
                             String string, String string2);
         void visitJumpInsn(int ifnonnull, @UnwrapParam(typeMethodName = "realType") Label
nonNullLabel);
+        
+        @WrapReturn(AnnotationVisitor.class)
+        AnnotationVisitor visitAnnotation(String cls, boolean b);
     }
     public interface AnnotationVisitor {
         void visit(String arg0, @UnwrapParam(typeMethodName = "realType") ASMType arg1);

Modified: cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFormatValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFormatValidator.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFormatValidator.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFormatValidator.java
Tue Jun  4 20:52:14 2013
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.bindings.xformat.XMLBindingMessageFormat;
@@ -76,9 +75,9 @@ public class XMLFormatValidator extends 
             if (needRootNode) {
                 String path = "Binding(" + binding.getName().getLocalPart()
                     + "):BindingOperation(" + bo.getName() + ")";
-                List<ExtensibilityElement> inExtensors =
-                    bo.getInput().getExtensors(ExtensibilityElement.class);
-                Iterator<ExtensibilityElement> itIn = null;
+                List<XMLBindingMessageFormat> inExtensors =
+                    bo.getInput().getExtensors(XMLBindingMessageFormat.class);
+                Iterator<XMLBindingMessageFormat> itIn = null;
                 if (inExtensors != null) {
                     itIn = inExtensors.iterator();
                 }
@@ -93,9 +92,9 @@ public class XMLFormatValidator extends 
                         needRootNode = true;
                     }
                     if (needRootNode) {
-                        List<ExtensibilityElement> outExtensors =
-                            bo.getOutput().getExtensors(ExtensibilityElement.class);
-                        Iterator<ExtensibilityElement> itOut = null;
+                        List<XMLBindingMessageFormat> outExtensors =
+                            bo.getOutput().getExtensors(XMLBindingMessageFormat.class);
+                        Iterator<XMLBindingMessageFormat> itOut = null;
                         if (outExtensors != null) {
                             itOut = outExtensors.iterator();
                         }
@@ -111,20 +110,17 @@ public class XMLFormatValidator extends 
         return true;
     }
 
-    private boolean findXMLFormatRootNode(Iterator<ExtensibilityElement> it, 
+    private boolean findXMLFormatRootNode(Iterator<XMLBindingMessageFormat> it, 
                                           BindingOperationInfo bo,
                                           String errorPath) {
         while (it != null && it.hasNext()) {
-            ExtensibilityElement ext = it.next();
-            if (ext instanceof XMLBindingMessageFormat) {
-                XMLBindingMessageFormat xmlFormat = (XMLBindingMessageFormat)ext;
-                if (xmlFormat.getRootNode() == null) {
-                    QName rootNodeName = bo.getName();
-                    addErrorMessage(errorPath
-                                    + ": empty value of rootNode attribute, the value should
be "
-                                    + rootNodeName);
-                    return false;                    
-                }
+            XMLBindingMessageFormat xmlFormat = it.next();
+            if (xmlFormat.getRootNode() == null) {
+                QName rootNodeName = bo.getName();
+                addErrorMessage(errorPath
+                                + ": empty value of rootNode attribute, the value should
be "
+                                + rootNodeName);
+                return false;                    
             }
         }
         return true;

Modified: cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/wsdl11/XmlIoPlugin.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/wsdl11/XmlIoPlugin.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/wsdl11/XmlIoPlugin.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/wsdl11/XmlIoPlugin.java
Tue Jun  4 20:52:14 2013
@@ -38,7 +38,11 @@ public final class XmlIoPlugin extends A
         QName qname = getOption(args, QName.class);
 
         ExtensibilityElement ext = registry.createExtension(clz, ToolConstants.XML_FORMAT);
-        xmlFormat = (XMLBindingMessageFormat)((JAXBExtensibilityElement)ext).getValue();
+        if (ext instanceof JAXBExtensibilityElement) {
+            xmlFormat = (XMLBindingMessageFormat)((JAXBExtensibilityElement)ext).getValue();
+        } else {
+            xmlFormat = (XMLBindingMessageFormat)ext;
+        }
         xmlFormat.setRootNode(qname);
         return ext;
     }

Modified: cxf/branches/dkulp-nowsdl4j/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPWSDLExtensionLoader.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPWSDLExtensionLoader.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPWSDLExtensionLoader.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPWSDLExtensionLoader.java
Tue Jun  4 20:52:14 2013
@@ -40,8 +40,6 @@ public final class HTTPWSDLExtensionLoad
                        org.apache.cxf.transports.http.configuration.HTTPClientPolicy.class);
         createExtensor(manager, javax.wsdl.Port.class,
                        org.apache.cxf.transports.http.configuration.HTTPServerPolicy.class);
-        createExtensor(manager, javax.wsdl.Port.class,
-                       org.apache.cxf.wsdl.http.AddressType.class);
     }
     public void createExtensor(WSDLManager manager,
                                 Class<?> parentType,

Modified: cxf/branches/dkulp-nowsdl4j/rt/wsdl/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/wsdl/pom.xml?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/wsdl/pom.xml (original)
+++ cxf/branches/dkulp-nowsdl4j/rt/wsdl/pom.xml Tue Jun  4 20:52:14 2013
@@ -43,6 +43,10 @@
             <groupId>wsdl4j</groupId>
             <artifactId>wsdl4j</artifactId>
         </dependency>
+        <dependency>
+            <groupId>${cxf.asm.groupId}</groupId>
+            <artifactId>${cxf.asm.artifactId}</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>junit</groupId>

Modified: cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
Tue Jun  4 20:52:14 2013
@@ -53,6 +53,13 @@ import org.apache.cxf.common.classloader
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.common.util.ASMHelper.AnnotationVisitor;
+import org.apache.cxf.common.util.ASMHelper.ClassWriter;
+import org.apache.cxf.common.util.ASMHelper.FieldVisitor;
+import org.apache.cxf.common.util.ASMHelper.Label;
+import org.apache.cxf.common.util.ASMHelper.MethodVisitor;
+import org.apache.cxf.common.util.ASMHelper.Opcodes;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
@@ -67,6 +74,7 @@ public class JAXBExtensionHelper impleme
 
     final Class<?> typeClass;
     final String namespace;
+    Class<?> extensionClass;
     String jaxbNamespace;
 
     private JAXBContext context;
@@ -77,11 +85,15 @@ public class JAXBExtensionHelper impleme
                                String ns) {
         typeClass = cls;
         namespace = ns;
+        extensionClass = cls;
     }
     
     void setJaxbNamespace(String ns) {
         jaxbNamespace = ns;
     }
+    void setExtensionClass(Class<?> cls) {
+        extensionClass = cls;
+    }
     
     public static void addExtensions(ExtensionRegistry registry, String parentType, String
elementType)
         throws JAXBException, ClassNotFoundException {
@@ -117,6 +129,7 @@ public class JAXBExtensionHelper impleme
         
         JAXBExtensionHelper helper = new JAXBExtensionHelper(cls, namespace);
         boolean found = false;
+        Class<?> extCls = cls;
         try {
             Class<?> objectFactory = Class.forName(PackageUtils.getPackageName(cls)
+ ".ObjectFactory",
                                                    true, cls.getClassLoader());
@@ -133,9 +146,13 @@ public class JAXBExtensionHelper impleme
                             helper.setJaxbNamespace(elementDecl.namespace());
                         }
                         QName elementType = new QName(ns, name);
+                        if (!ExtensibilityElement.class.isAssignableFrom(extCls)) {
+                            extCls = createExtensionClass(cls, elementType);
+                            helper.setExtensionClass(extCls);
+                        }
                         registry.registerDeserializer(parentType, elementType, helper); 
                         registry.registerSerializer(parentType, elementType, helper);   
                     
-                        registry.mapExtensionTypes(parentType, elementType, cls);
+                        registry.mapExtensionTypes(parentType, elementType, extCls);
                         found = true;
                     }                    
                 }
@@ -166,9 +183,13 @@ public class JAXBExtensionHelper impleme
                         ns = namespace;
                     }
                     QName elementType = new QName(ns, name);
+                    if (!ExtensibilityElement.class.isAssignableFrom(extCls)) {
+                        extCls = createExtensionClass(cls, elementType);
+                        helper.setExtensionClass(extCls);
+                    }
                     registry.registerDeserializer(parentType, elementType, helper); 
                     registry.registerSerializer(parentType, elementType, helper);       
                 
-                    registry.mapExtensionTypes(parentType, elementType, cls);
+                    registry.mapExtensionTypes(parentType, elementType, extCls);
 
                     found = true;
                 }
@@ -181,11 +202,13 @@ public class JAXBExtensionHelper impleme
         }
     }
 
+
+
     private synchronized JAXBContext getContext() throws JAXBException {
         if (context == null || classes == null) {
             try {
                 CachedContextAndSchemas ccs 
-                    = JAXBContextCache.getCachedContextAndSchemas(typeClass);
+                    = JAXBContextCache.getCachedContextAndSchemas(typeClass, extensionClass);
                 classes = ccs.getClasses();
                 context = ccs.getContext();
             } catch (JAXBException e) {
@@ -281,11 +304,11 @@ public class JAXBExtensionHelper impleme
         
             Object o = null;
             if (namespace == null) {
-                o = u.unmarshal(element);
+                o = u.unmarshal(element, extensionClass);
             } else {
                 reader = StaxUtils.createXMLStreamReader(element);
                 reader = new MappingReaderDelegate(reader);
-                o = u.unmarshal(reader);
+                o = u.unmarshal(reader, extensionClass);
             }
             if (o instanceof JAXBElement<?>) {
                 JAXBElement<?> el = (JAXBElement<?>)o;
@@ -377,5 +400,129 @@ public class JAXBExtensionHelper impleme
         
     };
     
+    //CHECKSTYLE:OFF - very complicated ASM code
+    private static Class<?> createExtensionClass(Class<?> cls, QName qname) {
+        
+        String className = ASMHelper.periodToSlashes(cls.getName());
+        ASMHelper helper = new ASMHelper();
+        Class<?> extClass = helper.findClass(className + "Extensibility", cls);
+        if (extClass != null) {
+            return extClass;
+        }
+        
+        ClassWriter cw = helper.createClassWriter();
+        FieldVisitor fv;
+        MethodVisitor mv;
+        AnnotationVisitor av0;
+        
+        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, 
+                 className + "Extensibility", null, 
+                 className, 
+                 new String[] {"javax/wsdl/extensions/ExtensibilityElement"});
+
+        cw.visitSource(cls.getSimpleName() + "Extensibility.java", null);
+        fv = cw.visitField(0, "qn", "Ljavax/xml/namespace/QName;", null, null);
+        fv.visitEnd();
+
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        Label l0 = helper.createLabel();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(33, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, className, "<init>", "()V");
+        Label l1 = helper.createLabel();
+        mv.visitLabel(l1);
+        mv.visitLineNumber(31, l1);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitTypeInsn(Opcodes.NEW, "javax/xml/namespace/QName");
+        mv.visitInsn(Opcodes.DUP);
+        
+        mv.visitLdcInsn(qname.getNamespaceURI());
+        mv.visitLdcInsn(qname.getLocalPart());
+        
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName",
+                           "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
+        mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility",
+                          "qn", "Ljavax/xml/namespace/QName;");
+        Label l2 = helper.createLabel();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(34, l2);
+        mv.visitInsn(Opcodes.RETURN);
+        Label l3 = helper.createLabel();
+        mv.visitLabel(l3);
+       
+        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l3, 0);
+        mv.visitMaxs(5, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setElementType", "(Ljavax/xml/namespace/QName;)V",
null, null);
+        mv.visitCode();
+        l0 = helper.createLabel();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(37, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility", "qn", "Ljavax/xml/namespace/QName;");
+        l1 = helper.createLabel();
+        mv.visitLabel(l1);
+        mv.visitLineNumber(38, l1);
+        mv.visitInsn(Opcodes.RETURN);
+        l2 = helper.createLabel();
+        mv.visitLabel(l2);
+        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l2, 0);
+        mv.visitLocalVariable("elementType", "Ljavax/xml/namespace/QName;", null, l0, l2,
1);
+        mv.visitMaxs(2, 2);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getElementType", "()Ljavax/xml/namespace/QName;",
null, null);
+        av0 = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
+        av0.visitEnd();
+        mv.visitCode();
+        l0 = helper.createLabel();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(40, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, className + "Extensibility", "qn", "Ljavax/xml/namespace/QName;");
+        mv.visitInsn(Opcodes.ARETURN);
+        l1 = helper.createLabel();
+        mv.visitLabel(l1);
+        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l1, 0);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setRequired", "(Ljava/lang/Boolean;)V",
null, null);
+        mv.visitCode();
+        l0 = helper.createLabel();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(44, l0);
+        mv.visitInsn(Opcodes.RETURN);
+        l1 = helper.createLabel();
+        mv.visitLabel(l1);
+        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l1, 0);
+        mv.visitLocalVariable("required", "Ljava/lang/Boolean;", null, l0, l1, 1);
+        mv.visitMaxs(0, 2);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getRequired", "()Ljava/lang/Boolean;", null,
null);
+        av0 = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
+        av0.visitEnd();
+        mv.visitCode();
+        l0 = helper.createLabel();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(46, l0);
+        mv.visitInsn(Opcodes.ACONST_NULL);
+        mv.visitInsn(Opcodes.ARETURN);
+        l1 = helper.createLabel();
+        mv.visitLabel(l1);
+        mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l1, 0);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        cw.visitEnd();
+
+        byte[] bytes = cw.toByteArray();
+        return helper.loadClass(className + "Extensibility", cls, bytes);
+    }    
 
 }

Modified: cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
Tue Jun  4 20:52:14 2013
@@ -174,7 +174,7 @@ public class WSDLToXMLProcessor extends 
             binding.addExtensibilityElement(getWSDLPlugin("xml", Binding.class).createExtension(null));
         } catch (WSDLException wse) {
             Message msg = new Message("FAIL_TO_CREATE_XMLBINDING", LOG);
-            throw new ToolException(msg);
+            throw new ToolException(msg, wse);
         }
     }
 

Modified: cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/wsdlto/misc/src/test/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessorTest.java
Tue Jun  4 20:52:14 2013
@@ -46,7 +46,7 @@ public class WSDLToXMLProcessorTest exte
 
     @Test
     public void testAllDefault() throws Exception {
-        String[] args = new String[] {"-i", "Greeter", "-d", output.getCanonicalPath(),
+        String[] args = new String[] {"-verbose", "-i", "Greeter", "-d", output.getCanonicalPath(),
                                       getLocation("/misctools_wsdl/hello_world.wsdl")};
         WSDLToXML.main(args);
 

Modified: cxf/branches/dkulp-nowsdl4j/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java?rev=1489597&r1=1489596&r2=1489597&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
Tue Jun  4 20:52:14 2013
@@ -34,6 +34,8 @@ import org.apache.cxf.bindings.xformat.X
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder;
 import org.apache.cxf.transport.jms.AddressType;
+import org.apache.cxf.wsdl.JAXBExtensibilityElement;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -71,8 +73,12 @@ public class JAXWSDefinitionBuilderTest 
         assertNotNull(port);
 
         assertEquals(1, port.getExtensibilityElements().size());
-        assertTrue(port.getExtensibilityElements().get(0).getClass().getName() + " is an
HTTPAddress",
-                   port.getExtensibilityElements().get(0) instanceof HTTPAddress);
+        Object obj = port.getExtensibilityElements().get(0);
+        if (obj instanceof JAXBExtensibilityElement) {
+            obj = ((JAXBExtensibilityElement)obj).getValue();
+        }
+        assertTrue(obj.getClass().getName() + " is an HTTPAddress",
+                   obj instanceof HTTPAddress);
 
         Binding binding = port.getBinding();
         assertNotNull(binding);
@@ -84,7 +90,12 @@ public class JAXWSDefinitionBuilderTest 
         BindingInput input = operation.getBindingInput();
         assertNotNull(input);
         assertEquals(1, input.getExtensibilityElements().size());
-        assertTrue(input.getExtensibilityElements().get(0) instanceof XMLBindingMessageFormat);
+        obj = input.getExtensibilityElements().get(0);
+        if (obj instanceof JAXBExtensibilityElement) {
+            obj = ((JAXBExtensibilityElement)obj).getValue();
+        }
+        assertTrue(obj.getClass().getName() + " is not an XMLBindingMessageFormat", 
+                   obj instanceof XMLBindingMessageFormat);
     }
 
     @Test



Mime
View raw message