cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r818947 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/ tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/...
Date Fri, 25 Sep 2009 18:46:20 GMT
Author: dkulp
Date: Fri Sep 25 18:46:20 2009
New Revision: 818947

URL: http://svn.apache.org/viewvc?rev=818947&view=rev
Log:
Merged revisions 818696 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r818696 | dkulp | 2009-09-24 22:15:23 -0400 (Thu, 24 Sep 2009) | 3 lines
  
  Fix an issue where java2ws tries to use the wsdlLocation attribute from
  the impl to create a wsdl, but if that wsdlLocation is a URI (like
  file://) that resulted in trying to create a file named "file://...".
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxwsServiceBuilder.java
    cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
    cxf/branches/2.2.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxwsServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxwsServiceBuilder.java?rev=818947&r1=818946&r2=818947&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxwsServiceBuilder.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxwsServiceBuilder.java
Fri Sep 25 18:46:20 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.jaxws;
 
 import java.io.File;
+import java.net.URI;
 
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.frontend.AbstractServiceFactory;
@@ -53,7 +54,23 @@
         JaxWsImplementorInfo jaxwsImpl = serviceFactory.getJaxWsImplementorInfo();
         String wsdlLocation = jaxwsImpl.getWsdlLocation();
         if (!StringUtils.isEmpty(wsdlLocation)) {
-            return new File(wsdlLocation);
+            try {
+                URI uri = new URI(wsdlLocation);
+                if ("file".equals(uri.getScheme()) 
+                    || StringUtils.isEmpty(uri.getScheme())) {
+                    File f = new File(uri);
+                    if (f.exists()) {
+                        return f;
+                    }
+                }
+            } catch (Exception e) {
+                //ignore
+            }
+            
+            File f = new File(wsdlLocation);
+            if (f.exists()) {
+                return f;
+            }
         }
         return super.getOutputFile();
     }

Modified: cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java?rev=818947&r1=818946&r2=818947&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/AbstractGenerator.java
Fri Sep 25 18:46:20 2009
@@ -77,7 +77,7 @@
             return null;
         }
         File parentDir = new File(parent);
-        if (parentDir.isDirectory() && !parentDir.exists()) {
+        if (!parentDir.exists()) {
             parentDir.mkdirs();
         }
         return parentDir;

Modified: cxf/branches/2.2.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?rev=818947&r1=818946&r2=818947&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
Fri Sep 25 18:46:20 2009
@@ -34,8 +34,6 @@
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ProcessorTestBase;
-import org.apache.cxf.tools.fortest.classnoanno.docbare.Stock;
-import org.apache.cxf.tools.fortest.withannotation.doc.Hello;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.WSDL11Generator;
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.transport.DestinationFactoryManager;
@@ -68,16 +66,6 @@
     }
 
     @Test
-    public void testGetOutputFile() {
-        builder.setServiceClass(Stock.class);
-        assertNull(builder.getOutputFile());
-        builder.setServiceClass(Hello.class);
-        assertNotNull(builder.getOutputFile());
-        File expected = new File("file:///c:/tmp.wsdl");
-        assertTrue(expected.equals(builder.getOutputFile()));
-    }
-
-    @Test
     public void testDocLitWrappedWithWrapperClass() throws Exception {
         builder.setServiceClass(org.apache.cxf.tools.fortest.withannotation.doc.StockWrapped.class);
         ServiceInfo service = builder.createService();



Mime
View raw message