cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r601693 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/ws/addressing/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/se...
Date Thu, 06 Dec 2007 10:53:23 GMT
Author: mmao
Date: Thu Dec  6 02:53:21 2007
New Revision: 601693

URL: http://svn.apache.org/viewvc?rev=601693&view=rev
Log:
CXF-1190 
  * Java2Ws support generate the WS-A wsdl extensions


Added:
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/extensions.xml
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/catalog.cat
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb
    incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/ws/addr/pom.xml
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
Thu Dec  6 02:53:21 2007
@@ -27,9 +27,12 @@
  * A container for WS-Addressing constants.
  */
 public final class JAXWSAConstants {
+    
+    public static final String WSAW = "http://www.w3.org/2006/05/addressing/wsdl"; 
 
-    public static final QName WSAW_ACTION_QNAME = new QName("http://www.w3.org/2006/05/addressing/wsdl",

-                                                            "Action");
+    public static final QName WSAW_ACTION_QNAME = new QName(WSAW,  "Action");
+    
+    public static final QName WSAW_USINGADDRESSING_QNAME = new QName(WSAW, "UsingAddressing");
 
     /**
      * Well-known Property names for AddressingProperties in BindingProvider

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
Thu Dec  6 02:53:21 2007
@@ -45,6 +45,7 @@
 import javax.wsdl.Service;
 import javax.wsdl.Types;
 import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.AttributeExtensible;
 import javax.wsdl.extensions.ElementExtensible;
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
@@ -229,6 +230,17 @@
         }
     }
     
+    private void addExtensibilityAttributes(AttributeExtensible attributeExtensible, 
+                                            Map<QName, Object> attributes) {
+        if (attributes == null) {
+            return;
+        }
+        for (QName qname : attributes.keySet()) {
+            addNamespace(qname.getNamespaceURI());
+            attributeExtensible.setExtensionAttribute(qname, attributes.get(qname));
+        }
+    }
+    
     /**
      * For a schema, require all namespace with prefixes to be imported. In theory,
      * if a namespace has a prefix but is not used, the import is not needed, and could
@@ -437,6 +449,21 @@
         ns2prefix.put(namespaceURI, prefix);
         def.addNamespace(prefix, namespaceURI);
     }
+    
+    private OperationInfo getOperationInfo(OperationInfo operation) {
+        if (operation.getUnwrappedOperation() != null) {
+            return operation.getUnwrappedOperation();
+        }
+        return operation;
+    }
+    
+    private Map<QName, Object> getInputExtensionAttributes(OperationInfo operation)
{
+        return getOperationInfo(operation).getInput().getExtensionAttributes();
+    }
+    
+    private Map<QName, Object> getOutputExtensionAttributes(OperationInfo operation)
{
+        return getOperationInfo(operation).getOutput().getExtensionAttributes();
+    }    
 
     protected void buildPortTypeOperation(PortType portType,
                                           Collection<OperationInfo> operationInfos,
@@ -462,6 +489,7 @@
                 input.setName(operationInfo.getInputName());
                 Message message = def.createMessage();
                 buildMessage(message, operationInfo.getInput(), def);
+                this.addExtensibilityAttributes(input, getInputExtensionAttributes(operationInfo));
                 input.setMessage(message);
                 operation.setInput(input);
                 
@@ -470,6 +498,7 @@
                     output.setName(operationInfo.getOutputName());
                     message = def.createMessage();
                     buildMessage(message, operationInfo.getOutput(), def);
+                    this.addExtensibilityAttributes(output, getOutputExtensionAttributes(operationInfo));
                     output.setMessage(message);
                     operation.setOutput(output);
                 }
@@ -481,6 +510,7 @@
                     fault.setName(faultInfo.getFaultName().getLocalPart());
                     message = def.createMessage();
                     buildMessage(message, faultInfo, def);
+                    this.addExtensibilityAttributes(fault, faultInfo.getExtensionAttributes());
                     fault.setMessage(message);
                     operation.addFault(fault);
                 }
@@ -516,6 +546,7 @@
     protected void buildMessage(Message message,
                                 AbstractMessageContainer messageContainer,
                                 final Definition def) {
+                
         message.setQName(messageContainer.getName());
         message.setUndefined(false);
         def.addMessage(message);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
Thu Dec  6 02:53:21 2007
@@ -21,8 +21,11 @@
 
 import java.util.List;
 
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensionRegistry;
 import javax.xml.ws.Binding;
 import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.Addressing;
 import javax.xml.ws.soap.AddressingFeature;
 import javax.xml.ws.soap.MTOMFeature;
 import javax.xml.ws.soap.SOAPBinding;
@@ -54,8 +57,11 @@
 import org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
+import org.apache.cxf.wsdl.WSDLManager;
 
 /**
  * A JAX-WS specific implementation of the CXF {@link org.apache.cxf.endpoint.Endpoint} interface.
@@ -73,11 +79,11 @@
     private List<AbstractFeature> features;
     
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException
{
-        this(bus, s, ei, null, null, null);
+        this(bus, s, ei, null, null, null, true);
     }
 
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei, JaxWsImplementorInfo implementorInfo,

-                             List<WebServiceFeature> wf, List<AbstractFeature>
af)
+                             List<WebServiceFeature> wf, List<AbstractFeature>
af, boolean isFromWsdl)
         throws EndpointException {
         super(bus, s, ei);
         this.implInfo = implementorInfo;
@@ -136,8 +142,39 @@
         if (getBinding() instanceof SoapBinding) {
             inFault.add(new SOAPHandlerFaultInInterceptor(jaxwsBinding));
         }
+        
+        if (!isFromWsdl) {
+            buildWsdlExtensibilities(ei.getBinding());
+        }
     }
     
+    private void buildWsdlExtensibilities(BindingInfo bindingInfo) {
+        Addressing addressing = getAddressing();
+        if (addressing != null) {            
+            ExtensionRegistry extensionRegistry = getBus().getExtension(WSDLManager.class)
+            .getExtenstionRegistry();            
+            try {
+                bindingInfo.addExtensor(extensionRegistry.createExtension(javax.wsdl.Binding.class,

+                                                                          JAXWSAConstants.
+                                                                          WSAW_USINGADDRESSING_QNAME));
+            } catch (WSDLException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }        
+    }
+
+    private Addressing getAddressing() {
+        Class<?> serviceClass = implInfo.getSEIClass();
+        if (serviceClass == null) {
+            serviceClass = implInfo.getImplementorClass();
+        }
+        if (serviceClass == null) {
+            return null;
+        }
+        return serviceClass.getAnnotation(Addressing.class);
+    }
+
     public Binding getJaxwsBinding() {
         return jaxwsBinding;
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Thu Dec  6 02:53:21 2007
@@ -141,8 +141,9 @@
     }
 
     @Override
-    public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
-        return new JaxWsEndpointImpl(getBus(), getService(), ei, implInfo, wsFeatures, this.getFeatures());
+    public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {        
+        return new JaxWsEndpointImpl(getBus(), getService(), ei, implInfo, wsFeatures, 
+                                     this.getFeatures(), this.isFromWsdl());
     }
 
     @Override

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Dec  6 02:53:21 2007
@@ -355,11 +355,14 @@
         }
     }
 
-
+    protected boolean isFromWsdl() {
+        return !populateFromClass && getWsdlURL() != null;        
+    }
+    
     protected void initializeServiceModel() {
         String wsdlurl = getWsdlURL();
 
-        if (!populateFromClass && wsdlurl != null) {
+        if (isFromWsdl()) {
             buildServiceFromWSDL(wsdlurl);
         } else {
             buildServiceFromClass();

Modified: incubator/cxf/trunk/rt/ws/addr/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/pom.xml?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/pom.xml (original)
+++ incubator/cxf/trunk/rt/ws/addr/pom.xml Thu Dec  6 02:53:21 2007
@@ -86,6 +86,38 @@
 
     </dependencies>
 
+    <build>
+	<plugins>
+	    <plugin>
+		<groupId>org.apache.cxf</groupId>
+		<artifactId>cxf-common-xsd</artifactId>
+		<version>${project.version}</version>
+		<executions>
+		    <execution>
+			<id>generate-sources</id>
+			<phase>generate-sources</phase>
+			<configuration>
+			    <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+			    <xsdOptions>
+				<xsdOption>
+				    <xsd>${basedir}/src/main/resources/schemas/ws-addr-wsdl.xsd</xsd>
+				    <bindingFile>${basedir}/src/main/resources/schemas/ws-addr-wsdl.xjb</bindingFile>
+                                    <catalog>${basedir}/src/main/resources/catalog.cat</catalog>
+				    <deleteDirs>
+					<deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
+				    </deleteDirs>
+				</xsdOption>
+			    </xsdOptions>
+			</configuration>
+			<goals>
+			    <goal>xsdtojava</goal>
+			</goals>
+		    </execution>
+		</executions>
+	    </plugin>
+	</plugins>
+    </build>
+
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/ws/addr</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/ws/addr</developerConnection>

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/extensions.xml?rev=601693&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/extensions.xml (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/extensions.xml Thu Dec  6 02:53:21
2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+    <!-- WS-A -->
+    <entry key="org.apache.cxf.ws.addressing-1">javax.wsdl.Binding=org.w3._2006._05.addressing.wsdl.UsingAddressing</entry>
+</properties>

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/catalog.cat
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/catalog.cat?rev=601693&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/catalog.cat (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/catalog.cat Thu Dec  6 02:53:21 2007
@@ -0,0 +1,21 @@
+--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+--
+
+
+SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb?rev=601693&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb Thu Dec  6
02:53:21 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<jaxb:bindings version="1.0" 
+  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
+  jaxb:extensionBindingPrefixes="xjc">
+    <jaxb:bindings schemaLocation="http://schemas.xmlsoap.org/wsdl/" node="/xs:schema">
+        <jaxb:schemaBindings>
+            <jaxb:package name="org.apache.cxf.wsdl"/>
+        </jaxb:schemaBindings>
+        <jaxb:globalBindings generateIsSetMethod="true"/>
+    </jaxb:bindings>
+    <jaxb:bindings schemaLocation="http://schemas.xmlsoap.org/wsdl/" node="/xs:schema/xs:complexType[@name='tExtensibilityElement']">
+        <jaxb:class implClass="org.apache.cxf.wsdl.TExtensibilityElementImpl"/>
+    </jaxb:bindings>
+</jaxb:bindings>

Added: incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd?rev=601693&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd (added)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd Thu Dec  6
02:53:21 2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	   xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+	   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	   targetNamespace="http://www.w3.org/2006/05/addressing/wsdl"
+	   elementFormDefault="qualified"
+	   xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">
+
+    <xs:import namespace="http://schemas.xmlsoap.org/wsdl/" schemaLocation="http://schemas.xmlsoap.org/wsdl/"
/>
+
+    <xs:complexType name="UsingAddressing">
+	<xs:complexContent>
+	    <xs:extension base="wsdl:tExtensibilityElement">
+		<xs:sequence />
+	    </xs:extension>
+	</xs:complexContent>
+    </xs:complexType>
+
+    <xs:element name="UsingAddressing" type="wsaw:UsingAddressing"/>
+
+</xs:schema>

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWSContainer.java
Thu Dec  6 02:53:21 2007
@@ -126,11 +126,6 @@
         }
     }
 
-    public Class getServiceClass(ToolContext context) {
-        return AnnotationUtil.loadClass((String)context.get(ToolConstants.CFG_CLASSNAME),
getClass()
-            .getClassLoader());
-    }
-
     public void checkParams(ErrorVisitor errs) throws ToolException {
         super.checkParams(errs);
         CommandDocument doc = super.getCommandDocument();

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=601693&r1=601692&r2=601693&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Thu Dec  6 02:53:21 2007
@@ -453,4 +453,21 @@
         String expectedFile = getClass().getResource("expected/expected_send_image2.wsdl").getFile();
         assertWsdlEquals(new File(expectedFile), wsdlFile);
     }
+
+    @Test
+    public void testWSA() throws Exception {
+        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/add_numbers.wsdl");
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.AddNumbersImpl");
+        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+        try {
+            processor.setEnvironment(env);
+            processor.process();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        File wsdlFile = new File(output, "add_numbers.wsdl");
+        assertTrue("Generate Wsdl Fail", wsdlFile.exists());
+        String expectedFile = getClass().getResource("expected/add_numbers_expected.wsdl").getFile();
+        assertWsdlEquals(new File(expectedFile), wsdlFile);
+    }
 }



Mime
View raw message